Merge pull request #7785 from DaisukeHashimoto/fix_CCActionManagerEx_Bug

use fileName for _actionDic key
This commit is contained in:
minggo 2014-10-10 11:13:41 +08:00
commit 2a95286329
1 changed files with 5 additions and 1 deletions

View File

@ -115,7 +115,11 @@ void ActionManagerEx::initWithDictionary(const char* jsonName,const rapidjson::V
ActionObject* ActionManagerEx::getActionByName(const char* jsonName,const char* actionName)
{
auto iterator = _actionDic.find(jsonName);
std::string path = jsonName;
ssize_t pos = path.find_last_of("/");
std::string fileName = path.substr(pos+1,path.length());
CCLOG("find filename == %s",fileName.c_str());
auto iterator = _actionDic.find(fileName);
if (iterator == _actionDic.end())
{
return nullptr;