Author: cazfi
Date: Sat Sep 19 20:47:19 2015
New Revision: 29931

URL: http://svn.gna.org/viewcvs/freeciv?rev=29931&view=rev
Log:
Do not load extras with cause EC_HUT from the savegame if have_huts is FALSE.
Always save have_huts as TRUE on regular savegames.

See bug #21345

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=29931&r1=29930&r2=29931&view=diff
==============================================================================
--- branches/S2_6/server/savegame2.c    (original)
+++ branches/S2_6/server/savegame2.c    Sat Sep 19 20:47:19 2015
@@ -1164,7 +1164,8 @@
     if (pextra == NULL) {
       continue;
     }
-    if (bin & (1 << i)) {
+    if ((bin & (1 << i))
+        && (map.server.have_huts || !is_extra_caused_by(pextra, EC_HUT))) {
       BV_SET(*extras, extra_index(pextra));
     }
   }
@@ -2681,7 +2682,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

Reply via email to