Author: cazfi
Date: Thu Apr 28 05:59:11 2016
New Revision: 32512

URL: http://svn.gna.org/viewcvs/freeciv?rev=32512&view=rev
Log:
Have 'have_resources' as map parameter, and not as general capability 
'specials', in savegame3.c saves.

See patch #7148

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=32512&r1=32511&r2=32512&view=diff
==============================================================================
--- trunk/server/savegame2.c    (original)
+++ trunk/server/savegame2.c    Thu Apr 28 05:59:11 2016
@@ -1801,7 +1801,7 @@
   /* 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.
+   *   1) scenario maps have it explicitly 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");

Modified: trunk/server/savegame3.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savegame3.c?rev=32512&r1=32511&r2=32512&view=diff
==============================================================================
--- trunk/server/savegame3.c    (original)
+++ trunk/server/savegame3.c    Thu Apr 28 05:59:11 2016
@@ -272,7 +272,7 @@
 static const char savefile_options_default[] =
   " +version3";
 /* The following savefile option are added if needed:
- *  - specials
+ *  - nothing at current version
  * See also calls to sg_save_savefile_options(). */
 
 static const char num_chars[] =
@@ -2400,10 +2400,12 @@
 
   /* This defaults to TRUE even if map has not been generated.
    * We rely on that
-   *   1) scenario maps have it explicity right.
+   *   1) scenario maps have it explicitly 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");
+  game.map.server.have_resources
+    = secfile_lookup_bool_default(loading->file, TRUE, "map.have_resources");
 
   if (S_S_INITIAL == loading->server_state
       && MAPGEN_SCENARIO == game.map.server.generator) {
@@ -2447,8 +2449,10 @@
 
   if (saving->scenario) {
     secfile_insert_bool(saving->file, game.map.server.have_huts, 
"map.have_huts");
+    secfile_insert_bool(saving->file, game.map.server.have_resources, 
"map.have_resources");
   } else {
     secfile_insert_bool(saving->file, TRUE, "map.have_huts");
+    secfile_insert_bool(saving->file, TRUE, "map.have_resources");
   }
 
   /* For debugging purposes only.
@@ -2552,7 +2556,7 @@
 
   if (S_S_INITIAL != loading->server_state
       || MAPGEN_SCENARIO != game.map.server.generator
-      || has_capability("specials", loading->secfile_options)) {
+      || game.map.server.have_resources) {
     whole_map_iterate(ptile) {
       extra_type_by_cause_iterate(EC_RESOURCE, pres) {
         if (tile_has_extra(ptile, pres)) {
@@ -2564,8 +2568,6 @@
         }
       } extra_type_by_cause_iterate_end;
     } whole_map_iterate_end;
-
-    game.map.server.have_resources = TRUE;
   }
 }
 
@@ -2576,10 +2578,6 @@
 {
   /* Check status and return if not OK (sg_success != TRUE). */
   sg_check_ret();
-
-  if (game.map.server.have_resources) {
-    sg_save_savefile_options(saving, " specials");
-  }
 
   /* Save extras. */
   halfbyte_iterate_extras(j, game.control.num_extra_types) {


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

Reply via email to