Author: sveinung
Date: Fri Oct 23 13:38:37 2015
New Revision: 30175

URL: http://svn.gna.org/viewcvs/freeciv?rev=30175&view=rev
Log:
Explicitly send target tile to city_build()

rather than sending it implicitly (the actor unit's location).

See patch #6461

Modified:
    trunk/server/unithand.c

Modified: trunk/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=30175&r1=30174&r2=30175&view=diff
==============================================================================
--- trunk/server/unithand.c     (original)
+++ trunk/server/unithand.c     Fri Oct 23 13:38:37 2015
@@ -133,7 +133,7 @@
 static bool city_add_unit(struct player *pplayer, struct unit *punit,
                           struct city *pcity);
 static bool city_build(struct player *pplayer, struct unit *punit,
-                       const char *name);
+                       struct tile *ptile, const char *name);
 static bool do_unit_establish_trade(struct player *pplayer,
                                     int unit_id,
                                     struct city *pcity_dest,
@@ -1847,7 +1847,7 @@
                                           actor_unit, target_tile)) {
         ACTION_STARTED_UNIT_TILE(action_type, actor_unit, target_tile);
 
-        return city_build(pplayer, actor_unit, name);
+        return city_build(pplayer, actor_unit, target_tile, name);
       } else if (unit_can_do_action(actor_unit, ACTION_FOUND_CITY)
                  && !unit_can_build_city(actor_unit)) {
         /* Keep the rules like they was before action enabler control:
@@ -2229,12 +2229,11 @@
   this returns TRUE, unit may have died during the action.
 **************************************************************************/
 static bool city_build(struct player *pplayer, struct unit *punit,
-                       const char *name)
+                       struct tile *ptile, const char *name)
 {
   char message[1024];
   int size;
   struct player *nationality;
-  struct tile *ptile;
   struct player *towner;
 
   /* Sanity check: The actor is still alive. */
@@ -2242,7 +2241,6 @@
     return FALSE;
   }
 
-  ptile = unit_tile(punit);
   towner = tile_owner(ptile);
 
   if (!is_allowed_city_name(pplayer, name, message, sizeof(message))) {


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

Reply via email to