Author: cazfi
Date: Thu Aug 18 07:37:50 2016
New Revision: 33638

URL: http://svn.gna.org/viewcvs/freeciv?rev=33638&view=rev
Log:
Make sure illegal border claims are cleared after a tile has transformed from 
land to ocean.

See bug #23179

Modified:
    trunk/server/maphand.c

Modified: trunk/server/maphand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/maphand.c?rev=33638&r1=33637&r2=33638&view=diff
==============================================================================
--- trunk/server/maphand.c      (original)
+++ trunk/server/maphand.c      Thu Aug 18 07:37:50 2016
@@ -81,6 +81,9 @@
 static inline int map_get_own_seen(const struct player *pplayer,
                                    const struct tile *ptile,
                                    enum vision_layer vlayer);
+
+static bool is_claimable_ocean(struct tile *ptile, struct tile *source,
+                               struct player *pplayer);
 
 /**************************************************************************
 Used only in global_warming() and nuclear_winter() below.
@@ -1775,6 +1778,7 @@
 void check_terrain_change(struct tile *ptile, struct terrain *oldter)
 {
   struct terrain *newter = tile_terrain(ptile);
+  struct tile *claimer;
 
   /* Check if new terrain is a freshwater terrain next to non-freshwater.
    * In that case, the new terrain is *changed*. */
@@ -1822,6 +1826,13 @@
   if (need_to_reassign_continents(oldter, newter)) {
     assign_continent_numbers();
     send_all_known_tiles(NULL);
+  }
+
+  claimer = tile_claimer(ptile);
+  if (claimer != NULL && is_ocean_tile(ptile)) {
+    if (!is_claimable_ocean(ptile, claimer, tile_owner(ptile))) {
+      map_clear_border(ptile);
+    }
   }
 
   sanity_check_tile(ptile);


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

Reply via email to