mirror of https://github.com/axmolengine/axmol.git
Update LuaStack.cpp
This commit is contained in:
parent
b228718022
commit
c359bea0dd
|
@ -627,7 +627,7 @@ int LuaStack::luaLoadChunksFromZIP(lua_State* L)
|
|||
{
|
||||
std::string code;
|
||||
ResizableBufferAdapter<std::string> adapter(&code);
|
||||
if (zip->getFileData(filename.c_str(), &adapter) && !code.empty())
|
||||
if (zip->getFileData(filename, &adapter) && !code.empty())
|
||||
{
|
||||
// remove .lua or .luac extension
|
||||
size_t pos = filename.find_last_of('.');
|
||||
|
@ -649,7 +649,7 @@ int LuaStack::luaLoadChunksFromZIP(lua_State* L)
|
|||
}
|
||||
}
|
||||
AXLOG("[luaLoadChunksFromZIP] add %s to preload", filename.c_str());
|
||||
if (stack->luaLoadBuffer(L, (char*)code.c_str(), (int)code.size(), filename.c_str()) == 0)
|
||||
if (stack->luaLoadBuffer(L, code.data(), static_cast<int>(code.size()), filename.c_str()) == 0)
|
||||
{
|
||||
lua_setfield(L, -2, filename.c_str());
|
||||
++count;
|
||||
|
|
Loading…
Reference in New Issue