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

Commit 0d7e996

Browse files
committed
Fix activity starting gold and fow enabled being lost if you save then load then restart
1 parent f809fe8 commit 0d7e996

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Activities/GameActivity.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ int GameActivity::ReadProperty(const std::string_view &propName, Reader &reader)
270270
SetTeamTech(team, techName);
271271
}
272272
}
273+
} else if (propName == "SpecialBehaviour_StartingGold") {
274+
reader >> m_StartingGold;
275+
} else if (propName == "SpecialBehaviour_FogOfWarEnabled") {
276+
reader >> m_FogOfWarEnabled;
273277
} else
274278
return Activity::ReadProperty(propName, reader);
275279

@@ -290,6 +294,10 @@ int GameActivity::Save(Writer &writer) const {
290294
writer.NewPropertyWithValue("DeliveryDelay", m_DeliveryDelay);
291295
writer.NewPropertyWithValue("BuyMenuEnabled", m_BuyMenuEnabled);
292296

297+
// Note - these special behaviour properties are for saving and loading. Normally these fields are set by the Activity config GUI.
298+
writer.NewPropertyWithValue("SpecialBehaviour_StartingGold", m_StartingGold);
299+
writer.NewPropertyWithValue("SpecialBehaviour_FogOfWarEnabled", m_FogOfWarEnabled);
300+
293301
for (int team = Teams::TeamOne; team < Teams::MaxTeamCount; team++) {
294302
writer.NewPropertyWithValue("Team" + std::to_string(team + 1) + "Tech", GetTeamTech(team));
295303
}

0 commit comments

Comments
 (0)