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

URL: http://svn.gna.org/viewcvs/freeciv?rev=29930&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:
    trunk/server/savegame2.c
    trunk/server/savegame3.c

Modified: trunk/server/savegame2.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savegame2.c?rev=29930&r1=29929&r2=29930&view=diff
==============================================================================
--- trunk/server/savegame2.c    (original)
+++ trunk/server/savegame2.c    Sat Sep 19 20:47:10 2015
@@ -817,7 +817,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));
     }
   }

Modified: trunk/server/savegame3.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savegame3.c?rev=29930&r1=29929&r2=29930&view=diff
==============================================================================
--- trunk/server/savegame3.c    (original)
+++ trunk/server/savegame3.c    Sat Sep 19 20:47:10 2015
@@ -1128,7 +1128,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));
     }
   }
@@ -2349,7 +2350,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