maybe fix the /run cmd
This commit is contained in:
parent
29dcec6afe
commit
1d23b7c1be
@ -106,9 +106,11 @@ LuaContext LuaRoot::createContext(StringList const& scriptPaths) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
newContext.set("loadstring", m_luaEngine->createFunction([&newContext](String const& source, Maybe<String> const& name, Maybe<LuaValue> const& env) -> LuaFunction {
|
auto handleIndex = newContext.handleIndex();
|
||||||
|
auto engine = m_luaEngine.get();
|
||||||
|
newContext.set("loadstring", m_luaEngine->createFunction([engine,handleIndex](String const& source, Maybe<String> const& name, Maybe<LuaValue> const& env) -> LuaFunction {
|
||||||
String functionName = name ? strf("loadstring: {}", *name) : "loadstring";
|
String functionName = name ? strf("loadstring: {}", *name) : "loadstring";
|
||||||
return newContext.engine().createFunctionFromSource(newContext.handleIndex(), source.utf8Ptr(), source.utf8Size(), functionName.utf8Ptr());
|
return engine->createFunctionFromSource(handleIndex, source.utf8Ptr(), source.utf8Size(), functionName.utf8Ptr());
|
||||||
}));
|
}));
|
||||||
|
|
||||||
auto assets = Root::singleton().assets();
|
auto assets = Root::singleton().assets();
|
||||||
|
Loading…
Reference in New Issue
Block a user