From cab5195ad4640bfdb8f47afb630372173d86fdeb Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 23 Mar 2017 10:43:39 +0800 Subject: [PATCH] find .luac first (#17572) --- cocos/scripting/lua-bindings/manual/CCLuaStack.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp b/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp index e19e9787d2..d4bcdf132d 100644 --- a/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp +++ b/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp @@ -259,18 +259,19 @@ int LuaStack::executeScriptFile(const char* filename) } FileUtils *utils = FileUtils::getInstance(); + // - // 1. check .lua suffix - // 2. check .luac suffix + // 1. check .luac suffix + // 2. check .lua suffix // - std::string tmpfilename = buf + NOT_BYTECODE_FILE_EXT; + std::string tmpfilename = buf + BYTECODE_FILE_EXT; if (utils->isFileExist(tmpfilename)) { buf = tmpfilename; } else { - tmpfilename = buf + BYTECODE_FILE_EXT; + tmpfilename = buf + NOT_BYTECODE_FILE_EXT; if (utils->isFileExist(tmpfilename)) { buf = tmpfilename;