mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-04 06:46:23 +00:00
add conditional variable to LuaResult
This commit is contained in:
@@ -606,9 +606,7 @@ TConsole::TConsole() {
|
||||
HandleLuaInternalCommand(cmd.substr(1));
|
||||
} else {
|
||||
auto Future = mLuaEngine->EnqueueScript(mStateId, { std::make_shared<std::string>(TrimmedCmd), "", "" });
|
||||
while (!Future->Ready) {
|
||||
std::this_thread::yield(); // TODO: Add a timeout
|
||||
}
|
||||
Future->WaitUntilReady();
|
||||
if (Future->Error) {
|
||||
beammp_lua_error("error in " + mStateId + ": " + Future->ErrorMessage);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user