Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit cd1d4f4

Browse files
committed
Fix saving getting locked if you try to save in an activity that doesn't support it
Change error for unsupported activity to a message box instead of console print
1 parent 4cf0299 commit cd1d4f4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Managers/ActivityMan.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ namespace RTE {
6868
RTEError::ShowMessageBox("Cannot Save Game\nA game is currently being saved/loaded, try again shortly.");
6969
return false;
7070
}
71-
IncrementSavingThreadCount();
7271

7372
Scene *scene = g_SceneMan.GetScene();
7473
GAScripted *activity = dynamic_cast<GAScripted *>(g_ActivityMan.GetActivity());
@@ -78,7 +77,7 @@ namespace RTE {
7877
return false;
7978
}
8079
if (!g_ActivityMan.GetActivityAllowsSaving()) {
81-
g_ConsoleMan.PrintString("ERROR: This activity does not support saving! Make sure it's a scripted activity, and that it has an OnSave function. Note that multiplayer and conquest games cannot be saved like this.");
80+
RTEError::ShowMessageBox("Cannot Save Game - This Activity Does Not Support Saving!\n\nMake sure it's a scripted activity, and that it has an OnSave function.\nNote that multiplayer and conquest games cannot be saved like this.");
8281
return false;
8382
}
8483
if (scene->SaveData(c_UserScriptedSavesModuleName + "/" + fileName) < 0) {
@@ -87,6 +86,8 @@ namespace RTE {
8786
return false;
8887
}
8988

89+
IncrementSavingThreadCount();
90+
9091
// We need a copy of our scene, because we have to do some fixup to remove PLACEONLOAD items and only keep the current MovableMan state.
9192
std::unique_ptr<Scene> modifiableScene(dynamic_cast<Scene*>(scene->Clone()));
9293

0 commit comments

Comments
 (0)