From c50a621ceacaa5cfefdfc2708336760d92a39b61 Mon Sep 17 00:00:00 2001 From: elexis Date: Wed, 22 Jan 2020 14:05:17 +0000 Subject: [PATCH] Disable Quicksave during multiplayer, since the feature is not implemented and triggering it can crash the turnmanager. Differential Revision: https://code.wildfiregames.com/D2584 Comments By: Stan This was SVN commit r23429. --- binaries/data/mods/public/gui/session/hotkeys/misc.xml | 4 ++-- source/ps/scripting/JSInterface_SavedGame.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/binaries/data/mods/public/gui/session/hotkeys/misc.xml b/binaries/data/mods/public/gui/session/hotkeys/misc.xml index 2969076e63..bf60bd0a64 100644 --- a/binaries/data/mods/public/gui/session/hotkeys/misc.xml +++ b/binaries/data/mods/public/gui/session/hotkeys/misc.xml @@ -24,11 +24,11 @@ - Engine.QuickSave(getSavedGameData()); + if (!g_IsNetworked) Engine.QuickSave(getSavedGameData()); - Engine.QuickLoad(); + if (!g_IsNetworked) Engine.QuickLoad(); diff --git a/source/ps/scripting/JSInterface_SavedGame.cpp b/source/ps/scripting/JSInterface_SavedGame.cpp index 1c3fff57b7..933008e397 100644 --- a/source/ps/scripting/JSInterface_SavedGame.cpp +++ b/source/ps/scripting/JSInterface_SavedGame.cpp @@ -54,7 +54,9 @@ void JSI_SavedGame::SaveGamePrefix(ScriptInterface::CxPrivate* pCxPrivate, const void JSI_SavedGame::QuickSave(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), JS::HandleValue GUIMetadata) { - if (g_Game) + if (g_NetServer || g_NetClient) + LOGERROR("Can't store quicksave during multiplayer!"); + else if (g_Game) g_Game->GetTurnManager()->QuickSave(GUIMetadata); else LOGERROR("Can't store quicksave if game is not running!"); @@ -62,7 +64,9 @@ void JSI_SavedGame::QuickSave(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), JS void JSI_SavedGame::QuickLoad(ScriptInterface::CxPrivate* UNUSED(pCxPrivate)) { - if (g_Game) + if (g_NetServer || g_NetClient) + LOGERROR("Can't load quicksave during multiplayer!"); + else if (g_Game) g_Game->GetTurnManager()->QuickLoad(); else LOGERROR("Can't load quicksave if game is not running!");