From b6aee36a0cccb5e7a8f8b519e38f35e6cdd0ef35 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Mon, 30 Dec 2019 01:48:00 -0500 Subject: [PATCH] Write hidden/visible state for EVERY town in the save file, even if it's equal to the scenario default This should fix #197 for any new saves created after the fix. --- src/universe/party.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/universe/party.cpp b/src/universe/party.cpp index dca68024..f8b54003 100644 --- a/src/universe/party.cpp +++ b/src/universe/party.cpp @@ -720,8 +720,9 @@ void cParty::writeTo(std::ostream& file, const cScenario& scen) const { for(int i = 0; i < scen.towns.size(); i++) { if(scen.towns[i]->item_taken.any()) file << "ITEMTAKEN " << i << ' ' << scen.towns[i]->item_taken << '\n'; - if(scen.towns[i]->can_find == scen.towns[i]->is_hidden) - file << (scen.towns[i]->can_find ? "TOWNVISIBLE " : "TOWNHIDDEN ") << i << '\n'; + if(scen.towns[i]->can_find) + file << "TOWNVISIBLE " << i << '\n'; + else file << "TOWNHIDDEN " << i << '\n'; if(scen.towns[i]->m_killed > 0) file << "TOWNSLAUGHTER " << i << ' ' << scen.towns[i]->m_killed << '\n'; }