<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39370 >

Oh bother, I see that while I was poking at keeping things backward
compatible, you made a sweeping change.  Ah well, here's my 2.1.0b4
proposal as applied to trunk....  Mix and match?

 /*************************************************************************
Index: server/citytools.c
===================================================================
--- server/citytools.c  (revision 12955)
+++ server/citytools.c  (working copy)
@@ -792,7 +792,7 @@
 
   give_citymap_from_player_to_player(pcity, pgiver, ptaker);
   old_vision = pcity->server.vision;
-  pcity->server.vision = vision_new(ptaker, pcity->tile, FALSE);
+  pcity->server.vision = vision_new(ptaker, pcity->tile, 
game.info.city_reveal_tiles);
   vision_layer_iterate(v) {
     vision_change_sight(pcity->server.vision, v,
                        vision_get_sight(old_vision, v));
@@ -976,7 +976,7 @@
   }
 
   /* Before arranging workers to show unknown land */
-  pcity->server.vision = vision_new(pplayer, ptile, FALSE);
+  pcity->server.vision = vision_new(pplayer, ptile, 
game.info.city_reveal_tiles);
   city_refresh_vision(pcity);
 
   tile_set_city(ptile, pcity);
Index: server/ruleset.c
===================================================================
--- server/ruleset.c    (revision 12955)
+++ server/ruleset.c    (working copy)
@@ -2575,6 +2575,7 @@
   game.info.angrycitizen =
     secfile_lookup_bool_default(file, GAME_DEFAULT_ANGRYCITIZEN,
                                 "parameters.angry_citizens");
+
   game.info.changable_tax = 
     secfile_lookup_bool_default(file, TRUE, "parameters.changable_tax");
   game.info.forced_science = 
@@ -2589,6 +2590,10 @@
     exit(EXIT_FAILURE);
   }
 
+  /* old versions didn't reveal tiles */
+  game.info.city_reveal_tiles = 
+    secfile_lookup_bool_default(file, FALSE, "parameters.vision_reveal_tiles");
+
   /* City Styles ... */
 
   styles = secfile_get_secnames_prefix(file, "citystyle_", &nval);
Index: server/savegame.c
===================================================================
--- server/savegame.c   (revision 12955)
+++ server/savegame.c   (working copy)
@@ -2426,7 +2426,7 @@
     }
     
     /* adding the cities contribution to fog-of-war */
-    pcity->server.vision = vision_new(pcity->owner, pcity->tile, FALSE);
+    pcity->server.vision = vision_new(pcity->owner, pcity->tile, 
game.info.city_reveal_tiles);
     city_refresh_vision(pcity);
 
     pcity->units_supported = unit_list_new();
 /***************************************************************
Index: data/default/cities.ruleset
===================================================================
--- data/default/cities.ruleset (revision 12955)
+++ data/default/cities.ruleset (working copy)
@@ -60,6 +60,8 @@
 ;forced_luxury = 100
 ;forced_gold = 0
 
+vision_reveal_tiles = 1          ; was default zero for old savegames
+
 ;
 ; City styles define the way cities are drawn
 ;
Index: common/packets.def
===================================================================
--- common/packets.def  (revision 12955)
+++ common/packets.def  (working copy)
@@ -425,6 +425,7 @@
   UINT8 allowed_city_names;
   IMPROVEMENT palace_building;
   IMPROVEMENT land_defend_building;
+  BOOL city_reveal_tiles;
   BOOL changable_tax;
   UINT8 forced_science;
   UINT8 forced_luxury;
Index: common/city.c
===================================================================
--- common/city.c       (revision 12955)
+++ common/city.c       (working copy)
@@ -2389,6 +2389,7 @@
   pcity->server.needs_arrange = FALSE;
   pcity->server.vision = NULL; /* No vision. */
 
+  pcity->ai.founder_boat = FALSE;
   pcity->ai.founder_want = 0; /* calculating this is really expensive */
   pcity->ai.next_founder_want_recalc = 0; /* turns to recalc found_want */
   pcity->ai.trade_want = 1; /* we always want some */
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to