fix pushGlobalContext error

This commit is contained in:
ErodeesFleurs 2024-03-22 15:56:20 +08:00
parent ec4787d78e
commit 443e6459b9

View File

@ -111,7 +111,7 @@ Assets::Assets(Settings settings, StringList assetSources) {
auto luaEngine = LuaEngine::create(); auto luaEngine = LuaEngine::create();
m_luaEngine = luaEngine; m_luaEngine = luaEngine;
auto pushGlobalContext = [&luaEngine](String const& name, LuaCallbacks & callbacks) { auto pushGlobalContext = [&luaEngine](String const& name, LuaCallbacks && callbacks) {
auto table = luaEngine->createTable(); auto table = luaEngine->createTable();
for (auto const& p : callbacks.callbacks()) for (auto const& p : callbacks.callbacks())
table.set(p.first, luaEngine->createWrappedFunction(p.second)); table.set(p.first, luaEngine->createWrappedFunction(p.second));