Author: cazfi Date: Wed Sep 9 20:43:25 2015 New Revision: 29841 URL: http://svn.gna.org/viewcvs/freeciv?rev=29841&view=rev Log: Do not load huts from the savegame if have_huts is FALSE. Always save have_huts as TRUE on regular savegames.
See bug #21345 Modified: branches/S2_5/server/savegame2.c Modified: branches/S2_5/server/savegame2.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/savegame2.c?rev=29841&r1=29840&r2=29841&view=diff ============================================================================== --- branches/S2_5/server/savegame2.c (original) +++ branches/S2_5/server/savegame2.c Wed Sep 9 20:43:25 2015 @@ -1264,6 +1264,17 @@ continue; } + if (sp == S_HUT && !map.server.have_huts) { + /* It would be logical to have this in the saving side - + * really not saving the huts in the first place, BUT + * 1) They have been saved by older versions, so we + * have to deal with such savegames. + * 2) This makes scenario author less likely to lose + * one's work completely after carefully placing huts + * and then saving with 'have_huts' disabled. */ + continue; + } + if (bin & (1 << i)) { if (sp == S_OLD_ROAD) { if (roads) { @@ -2516,7 +2527,11 @@ /* Check status and return if not OK (sg_success != TRUE). */ sg_check_ret(); - secfile_insert_bool(saving->file, map.server.have_huts, "map.have_huts"); + if (saving->scenario) { + secfile_insert_bool(saving->file, map.server.have_huts, "map.have_huts"); + } else { + secfile_insert_bool(saving->file, TRUE, "map.have_huts"); + } if (map_is_empty()) { /* No map. */ _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits