From eb0358fda6de02f8a353625057d27179b9e81cae Mon Sep 17 00:00:00 2001 From: James Chen Date: Sat, 27 Apr 2013 14:44:20 +0800 Subject: [PATCH] [Lua] Passing full path to luaL_dofile in CCLuaEngine::executeScriptFile. --- scripting/lua/cocos2dx_support/CCLuaStack.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripting/lua/cocos2dx_support/CCLuaStack.cpp b/scripting/lua/cocos2dx_support/CCLuaStack.cpp index bc62002487..484ce3fb42 100644 --- a/scripting/lua/cocos2dx_support/CCLuaStack.cpp +++ b/scripting/lua/cocos2dx_support/CCLuaStack.cpp @@ -191,8 +191,9 @@ int CCLuaStack::executeScriptFile(const char* filename) code.append("\""); return executeString(code.c_str()); #else + std::string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(filename); ++m_callFromLua; - int nRet = luaL_dofile(m_state, filename); + int nRet = luaL_dofile(m_state, fullPath.c_str()); --m_callFromLua; CC_ASSERT(m_callFromLua >= 0); // lua_gc(m_state, LUA_GCCOLLECT, 0);