Lua: Call local eventhandlers synchronously when TriggerGlobalEvent is called from inside a handling state

This commit is contained in:
Lion Kortlepel
2021-09-18 00:05:51 +02:00
parent 29a858e74a
commit f98ef7d41c
7 changed files with 52 additions and 27 deletions

View File

@@ -28,7 +28,7 @@ int main(int argc, char** argv) try {
bool Shutdown = false;
Application::RegisterShutdownHandler([&Shutdown] { Shutdown = true; });
Application::RegisterShutdownHandler([] {
auto Futures = LuaAPI::MP::Engine->TriggerEvent("onShutdown");
auto Futures = LuaAPI::MP::Engine->TriggerEvent("onShutdown", "");
TLuaEngine::WaitForAll(Futures);
});