Author: sveinung
Date: Fri Aug 15 16:08:07 2014
New Revision: 25918

URL: http://svn.gna.org/viewcvs/freeciv?rev=25918&view=rev
Log:
Make key_unit_diplomat_actions() dumber and therefore less redundant
   
Before spy acting against own tile key_unit_diplomat_actions() will check that
there is a city on it. At the moment this check isn't wrong. Spy actions vs
a unit that isn't alone at its tile are illegal. The only other target type is
cities. It could even be said to be slightly beneficial: if a client that would
ask that a unit acts against its own tile and no city is present will save a
round trip to the server.

The problem with the check is that its hard to discover. It would cause issues
if existing actions vs units are changed to no longer require the unit to alone
at its til or new actions that can target non cities are added. Remove it.

See patch #5035

Modified:
    trunk/client/control.c

Modified: trunk/client/control.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/control.c?rev=25918&r1=25917&r2=25918&view=diff
==============================================================================
--- trunk/client/control.c      (original)
+++ trunk/client/control.c      Fri Aug 15 16:08:07 2014
@@ -2710,12 +2710,10 @@
 **************************************************************************/
 void key_unit_diplomat_actions(void)
 {
-  struct city *pcity;          /* need pcity->id */
   struct tile *ptile;
   unit_list_iterate(get_units_in_focus(), punit) {
     if (is_diplomat_unit(punit)
-        && (ptile = unit_tile(punit))
-        && (pcity = tile_city(ptile))) {
+        && (ptile = unit_tile(punit))) {
       process_diplomat_arrival(punit, ptile->index);
       return;
       /* FIXME: diplomat dialog for more than one unit at a time. */


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

Reply via email to