From 986528c67db031891db93d1e48b85b924f0cc787 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Tue, 12 Mar 2019 02:15:20 +0200 Subject: [PATCH] [Server] Add error message as argument to OnServerScriptCrash --- apps/openmw-mp/Script/Script.hpp | 2 +- apps/openmw-mp/Script/ScriptFunctions.hpp | 2 +- apps/openmw-mp/main.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw-mp/Script/Script.hpp b/apps/openmw-mp/Script/Script.hpp index 101f0bd3a..47303bc59 100644 --- a/apps/openmw-mp/Script/Script.hpp +++ b/apps/openmw-mp/Script/Script.hpp @@ -105,7 +105,7 @@ public: catch (std::exception &e) { LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, e.what()); - Script::Call(); + Script::Call(e.what()); if (!mwmp::Networking::getPtr()->getScriptErrorIgnoringState()) throw; diff --git a/apps/openmw-mp/Script/ScriptFunctions.hpp b/apps/openmw-mp/Script/ScriptFunctions.hpp index 80c1c4145..016e21fa7 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.hpp +++ b/apps/openmw-mp/Script/ScriptFunctions.hpp @@ -156,7 +156,7 @@ public: {"OnServerInit", Callback<>()}, {"OnServerPostInit", Callback<>()}, {"OnServerExit", Callback()}, - {"OnServerScriptCrash", Callback<>()}, + {"OnServerScriptCrash", Callback()}, {"OnPlayerConnect", Callback()}, {"OnPlayerDisconnect", Callback()}, {"OnPlayerDeath", Callback()}, diff --git a/apps/openmw-mp/main.cpp b/apps/openmw-mp/main.cpp index 9adec8ca6..e7dab08e7 100644 --- a/apps/openmw-mp/main.cpp +++ b/apps/openmw-mp/main.cpp @@ -307,7 +307,7 @@ int main(int argc, char *argv[]) catch (std::exception &e) { LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, e.what()); - Script::Call(); + Script::Call(e.what()); throw; //fall through }