Lua: working events, global and local

This commit is contained in:
Lion Kortlepel
2021-09-16 18:14:11 +02:00
parent e602decb96
commit 1c80a4deb7
4 changed files with 75 additions and 36 deletions

View File

@@ -62,13 +62,12 @@ TConsole::TConsole() {
beammp_info("Lua not started yet, please try again in a second");
} else {
auto Future = mLuaEngine->EnqueueScript(mStateId, std::make_shared<std::string>(cmd));
// wait for it to finish
/*while (!Future->Ready) {
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
if (Future->Error) {
beammp_error(Future->ErrorMessage);
}*/
while (!Future->Ready) {
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
if (Future->Error) {
beammp_lua_error(Future->ErrorMessage);
}
}
}
};