Author: cazfi Date: Mon Apr 25 00:59:23 2016 New Revision: 32480 URL: http://svn.gna.org/viewcvs/freeciv?rev=32480&view=rev Log: When saving a game before map is even generated, do not save have_huts as TRUE.
See bug #24599 Modified: branches/S2_6/server/savegame2.c Modified: branches/S2_6/server/savegame2.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/savegame2.c?rev=32480&r1=32479&r2=32480&view=diff ============================================================================== --- branches/S2_6/server/savegame2.c (original) +++ branches/S2_6/server/savegame2.c Mon Apr 25 00:59:23 2016 @@ -2776,6 +2776,11 @@ /* Check status and return if not OK (sg_success != TRUE). */ sg_check_ret(); + /* This defaults to TRUE even if map has not been generated. Also, + * old versions have also explicitly saved TRUE even in pre-game. + * We rely on that + * 1) scenario maps have it explicity right. + * 2) when map is actually generated, it re-initialize this to FALSE. */ game.map.server.have_huts = secfile_lookup_bool_default(loading->file, TRUE, "map.have_huts"); @@ -2847,15 +2852,15 @@ /* Check status and return if not OK (sg_success != TRUE). */ sg_check_ret(); + if (map_is_empty()) { + /* No map. */ + return; + } + if (saving->scenario) { secfile_insert_bool(saving->file, game.map.server.have_huts, "map.have_huts"); } else { secfile_insert_bool(saving->file, TRUE, "map.have_huts"); - } - - if (map_is_empty()) { - /* No map. */ - return; } /* For debugging purposes only. _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits