Author: cazfi
Date: Sun Nov 30 21:14:24 2014
New Revision: 27159

URL: http://svn.gna.org/viewcvs/freeciv?rev=27159&view=rev
Log:
map_claim_border() will map_clear_border() when given NULL owner instead of 
crashing

Reported by Andreas Røsdal <andreasr>

See bug #22996

Modified:
    branches/S2_5/server/maphand.c

Modified: branches/S2_5/server/maphand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/maphand.c?rev=27159&r1=27158&r2=27159&view=diff
==============================================================================
--- branches/S2_5/server/maphand.c      (original)
+++ branches/S2_5/server/maphand.c      Sun Nov 30 21:14:24 2014
@@ -2050,6 +2050,14 @@
     return;
   }
 
+  if (owner == NULL) {
+    /* Clear the border instead of claiming. Code below this block
+     * cannot handle NULL owner. */
+    map_clear_border(ptile);
+
+    return;
+  }
+
   circle_dxyr_iterate(ptile, radius_sq, dtile, dx, dy, dr) {
     struct tile *dclaimer = tile_claimer(dtile);
 


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

Reply via email to