Skip to content

Commit 3592df1

Browse files
committed
Fixed scene name being missing from save
1 parent b0b026f commit 3592df1

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Source/Managers/ActivityMan.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ bool ActivityMan::SaveCurrentGame(const std::string& fileName) {
124124
}
125125
}
126126

127-
writer->NewPropertyWithValue("MaxUniqueID", currentMaxID);
128-
writer->NewPropertyWithValue("CurrentSimTicks", g_TimerMan.GetSimTickCount());
129127
writer->NewPropertyWithValue("OriginalScenePresetName", scene->GetPresetName());
130128
writer->NewPropertyWithValue("PlaceObjectsIfSceneIsRestarted", g_SceneMan.GetPlaceObjectsOnLoad());
131129
writer->NewPropertyWithValue("PlaceUnitsIfSceneIsRestarted", g_SceneMan.GetPlaceUnitsOnLoad());
132130
writer->NewPropertyWithValue("Scene", modifiableScene.get());
131+
writer->NewPropertyWithValue("MaxUniqueID", currentMaxID);
132+
writer->NewPropertyWithValue("CurrentSimTicks", g_TimerMan.GetSimTickCount());
133133

134134
auto saveWriterData = [](Writer* writerToSave) {
135135
writerToSave->EndWrite();
@@ -172,11 +172,6 @@ bool ActivityMan::LoadAndLaunchGame(const std::string& fileName) {
172172
std::string propName = reader.ReadPropName();
173173
if (propName == "Activity") {
174174
reader >> activity.get();
175-
} else if (propName == "MaxUniqueID") {
176-
reader >> maxUniqueID;
177-
g_MovableMan.SetShouldPersistUniqueIDs(true);
178-
} else if (propName == "CurrentSimTicks") {
179-
reader >> simTimeTicks;
180175
} else if (propName == "OriginalScenePresetName") {
181176
reader >> originalScenePresetName;
182177
} else if (propName == "PlaceObjectsIfSceneIsRestarted") {
@@ -185,6 +180,11 @@ bool ActivityMan::LoadAndLaunchGame(const std::string& fileName) {
185180
reader >> placeUnitsIfSceneIsRestarted;
186181
} else if (propName == "Scene") {
187182
reader >> scene.get();
183+
} else if (propName == "MaxUniqueID") {
184+
reader >> maxUniqueID;
185+
g_MovableMan.SetShouldPersistUniqueIDs(true);
186+
} else if (propName == "CurrentSimTicks") {
187+
reader >> simTimeTicks;
188188
}
189189
}
190190

Source/Menus/SaveLoadMenuGUI.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ void SaveLoadMenuGUI::PopulateSaveGamesList() {
102102

103103
std::string originalScenePresetName;
104104
while (reader.NextProperty()) {
105+
// This is a bit unsafe because it skips properties, but meh, doesn't matter as long as Activity and OriginalScenePresetName are first
105106
std::string propName = reader.ReadPropName();
106107
if (propName == "Activity") {
107108
reader >> activity;

0 commit comments

Comments
 (0)