diff --git a/apps/openmw-mp/Script/Script.hpp b/apps/openmw-mp/Script/Script.hpp index 87a547360..101f0bd3a 100644 --- a/apps/openmw-mp/Script/Script.hpp +++ b/apps/openmw-mp/Script/Script.hpp @@ -105,6 +105,7 @@ public: catch (std::exception &e) { LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, e.what()); + Script::Call(); if (!mwmp::Networking::getPtr()->getScriptErrorIgnoringState()) throw; diff --git a/apps/openmw-mp/Script/ScriptFunctions.hpp b/apps/openmw-mp/Script/ScriptFunctions.hpp index 0306dc748..80c1c4145 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.hpp +++ b/apps/openmw-mp/Script/ScriptFunctions.hpp @@ -156,6 +156,7 @@ public: {"OnServerInit", Callback<>()}, {"OnServerPostInit", Callback<>()}, {"OnServerExit", Callback()}, + {"OnServerScriptCrash", Callback<>()}, {"OnPlayerConnect", Callback()}, {"OnPlayerDisconnect", Callback()}, {"OnPlayerDeath", Callback()}, diff --git a/apps/openmw-mp/main.cpp b/apps/openmw-mp/main.cpp index 485398cec..9adec8ca6 100644 --- a/apps/openmw-mp/main.cpp +++ b/apps/openmw-mp/main.cpp @@ -307,6 +307,7 @@ int main(int argc, char *argv[]) catch (std::exception &e) { LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, e.what()); + Script::Call(); throw; //fall through }