Author: cazfi
Date: Mon Apr 25 00:59:29 2016
New Revision: 32481

URL: http://svn.gna.org/viewcvs/freeciv?rev=32481&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_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=32481&r1=32480&r2=32481&view=diff
==============================================================================
--- branches/S2_5/server/savegame2.c    (original)
+++ branches/S2_5/server/savegame2.c    Mon Apr 25 00:59:29 2016
@@ -2471,6 +2471,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. */
   map.server.have_huts
     = secfile_lookup_bool_default(loading->file, TRUE, "map.have_huts");
 
@@ -2534,15 +2539,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, map.server.have_huts, "map.have_huts");
   } else {
     secfile_insert_bool(saving->file, TRUE, "map.have_huts");
-  }
-
-  if (map_is_empty()) {
-    /* No map. */
-    return;
   }
 
   sg_save_map_tiles(saving);


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to