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

 $subject


 - ML

diff -Nurd -X.diff_ignore freeciv/server/citytools.c freeciv/server/citytools.c
--- freeciv/server/citytools.c  2008-10-27 04:13:36.000000000 +0200
+++ freeciv/server/citytools.c  2008-10-27 04:53:46.000000000 +0200
@@ -2299,17 +2299,26 @@
   int radius_sq = get_city_bonus(pcity, EFT_CITY_VISION_RADIUS_SQ);
 
   if (NULL != psite) {
+    int old_radius = psite->border_radius_sq;
+    int new_radius;
+
     /* Exact behavior could be ruleset defined. */
     if (game.info.borders_sq) {
-      psite->border_radius_sq = game.info.borders_sq;
+      new_radius = game.info.borders_sq;
       if (psite->identity > 0) {
         /* City */
-        psite->border_radius_sq = MAX(psite->border_radius_sq, 2*2+1*1);
+        new_radius = MAX(new_radius, 2*2+1*1);
       }
-      psite->border_radius_sq += psite->size;
+      new_radius += psite->size;
     } else {
-      psite->border_radius_sq = 0;
+      new_radius = 0;
+    }
+
+    if (old_radius > new_radius) {
+      map_clear_border(pcity->tile, pcity->owner);
     }
+
+    psite->border_radius_sq = new_radius;
   }
 
   vision_change_sight(pcity->server.vision, V_MAIN, radius_sq);
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to