mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2026-04-04 10:06:01 +00:00
Lua: Fix multiple issues with events
This commit is contained in:
@@ -58,16 +58,17 @@ TConsole::TConsole() {
|
||||
} else if (cmd == "clear" || cmd == "cls") {
|
||||
// TODO: clear screen
|
||||
} else {
|
||||
while (!mLuaEngine) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
}
|
||||
auto Future = mLuaEngine->EnqueueScript(mStateId, std::make_shared<std::string>(cmd));
|
||||
// wait for it to finish
|
||||
while (!Future->Ready) {
|
||||
if (!mLuaEngine) {
|
||||
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);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user