1
1
forked from 0ad/0ad

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.
This commit is contained in:
elexis 2020-01-22 14:05:17 +00:00
parent ed0a3f4290
commit c50a621cea
2 changed files with 8 additions and 4 deletions

View File

@ -24,11 +24,11 @@
</object> </object>
<object hotkey="quicksave"> <object hotkey="quicksave">
<action on="Press">Engine.QuickSave(getSavedGameData());</action> <action on="Press">if (!g_IsNetworked) Engine.QuickSave(getSavedGameData());</action>
</object> </object>
<object hotkey="quickload"> <object hotkey="quickload">
<action on="Press">Engine.QuickLoad();</action> <action on="Press">if (!g_IsNetworked) Engine.QuickLoad();</action>
</object> </object>
<object hotkey="session.kill"> <object hotkey="session.kill">

View File

@ -54,7 +54,9 @@ void JSI_SavedGame::SaveGamePrefix(ScriptInterface::CxPrivate* pCxPrivate, const
void JSI_SavedGame::QuickSave(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), JS::HandleValue GUIMetadata) 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); g_Game->GetTurnManager()->QuickSave(GUIMetadata);
else else
LOGERROR("Can't store quicksave if game is not running!"); 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)) 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(); g_Game->GetTurnManager()->QuickLoad();
else else
LOGERROR("Can't load quicksave if game is not running!"); LOGERROR("Can't load quicksave if game is not running!");