Author: sveinung
Date: Thu Dec 11 11:50:00 2014
New Revision: 27252

URL: http://svn.gna.org/viewcvs/freeciv?rev=27252&view=rev
Log:
Check that there is a city to help build the wonder in.

Restore the check that handle_unit_help_build_wonder() has a target city to help
that accidentally got removed in patch #5484.

See patch #5526

Modified:
    trunk/server/unithand.c

Modified: trunk/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=27252&r1=27251&r2=27252&view=diff
==============================================================================
--- trunk/server/unithand.c     (original)
+++ trunk/server/unithand.c     Thu Dec 11 11:50:00 2014
@@ -2019,6 +2019,11 @@
   }
 
   pcity_dest = game_city_by_number(city_id);
+
+  /* Sanity check: The target city still exists. */
+  if (NULL == pcity_dest) {
+    return;
+  }
 
   pcity_dest->shield_stock += unit_build_shield_cost(punit);
   pcity_dest->caravan_shields += unit_build_shield_cost(punit);


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

Reply via email to