semms fix the memory issue

This commit is contained in:
yzh 2024-02-13 14:52:45 +08:00
commit 2950259ede
No known key found for this signature in database
GPG Key ID: 42F9CE5DC67BB975
2 changed files with 2 additions and 2 deletions

View File

@ -106,7 +106,7 @@ 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 {
newContext.set("loadstring", m_luaEngine->createFunction([&newContext](String const& source, Maybe<String> const& name, Maybe<LuaValue> const& env) -> LuaFunction {
String functionName = name ? strf("loadstring: {}", *name) : "loadstring";
return newContext.engine().createFunctionFromSource(newContext.handleIndex(), source.utf8Ptr(), source.utf8Size(), functionName.utf8Ptr());
}));

View File

@ -81,7 +81,7 @@ int main(int argc, char** argv) {
lastReport = Time::monotonicTime();
coutf("[{}] {}s | FPS: {} | Entities: {}\n", j, Time::monotonicTime() - start, fps, entityCount);
}
worldServer.update();
worldServer.update(ServerGlobalTimestep * GlobalTimescale);
}
double totalTime = Time::monotonicTime() - start;
coutf("Finished run of running dungeon world '{}' with seed {} for {} steps in {} seconds, average FPS: {}\n",