Author: sveinung
Date: Wed Jul  8 14:07:29 2015
New Revision: 29206

URL: http://svn.gna.org/viewcvs/freeciv?rev=29206&view=rev
Log:
Remove custom foreign city explanation for city joining.

The system that explains why an action is illegal can now detect if an
action is illegal because the target city is foreign.

See patch #6126

Modified:
    trunk/common/unit.c
    trunk/common/unit.h
    trunk/server/cityhand.c
    trunk/server/unithand.c

Modified: trunk/common/unit.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/unit.c?rev=29206&r1=29205&r2=29206&view=diff
==============================================================================
--- trunk/common/unit.c (original)
+++ trunk/common/unit.c Wed Jul  8 14:07:29 2015
@@ -421,14 +421,6 @@
 
   if (new_pop > game.info.add_to_size_limit) {
     return UAB_TOO_BIG;
-  }
-  if (city_owner(pcity) != unit_owner(punit)
-      /* TODO: Remove UAB_NOT_OWNER when doing so is safe. */
-      /* The ruleset may allow joining foreign cities. */
-      && !can_utype_do_act_if_tgt_diplrel(unit_type(punit),
-                                          ACTION_JOIN_CITY,
-                                          DRO_FOREIGN, TRUE)) {
-    return UAB_NOT_OWNER;
   }
   if (!city_can_grow_to(pcity, new_pop)) {
     return UAB_NO_SPACE;

Modified: trunk/common/unit.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/unit.h?rev=29206&r1=29205&r2=29206&view=diff
==============================================================================
--- trunk/common/unit.h (original)
+++ trunk/common/unit.h Wed Jul  8 14:07:29 2015
@@ -62,7 +62,6 @@
   UAB_NO_MIN_DIST,      /* Equivalent to 'CB_NO_MIN_DIST'. */
   UAB_NOT_ADDABLE_UNIT, /* Unit is not one that can be added to cities. */
   UAB_NOT_BUILD_UNIT,   /* Unit is not one that can build cities. */
-  UAB_NOT_OWNER,        /* Owner of unit is not owner of city. */
   UAB_TOO_BIG,          /* City is too big to be added to. */
   UAB_NO_SPACE          /* Adding takes city past limit. */
 };

Modified: trunk/server/cityhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/cityhand.c?rev=29206&r1=29205&r2=29206&view=diff
==============================================================================
--- trunk/server/cityhand.c     (original)
+++ trunk/server/cityhand.c     Wed Jul  8 14:07:29 2015
@@ -91,7 +91,6 @@
 
   case UAB_ADD_OK:
   case UAB_NOT_ADDABLE_UNIT:
-  case UAB_NOT_OWNER:
   case UAB_TOO_BIG:
   case UAB_NO_SPACE:
     log_verbose("handle_city_name_suggest_req(unit_pos (%d, %d)): "

Modified: trunk/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=29206&r1=29205&r2=29206&view=diff
==============================================================================
--- trunk/server/unithand.c     (original)
+++ trunk/server/unithand.c     Wed Jul  8 14:07:29 2015
@@ -1735,14 +1735,6 @@
                       _("Can't add to a city."));
       }
     }
-    break;
-  case UAB_NOT_OWNER:
-    notify_player(pplayer, ptile, E_BAD_COMMAND, ftc_server,
-                  /* TRANS: <city> is owned by <nation>, cannot add <unit>. */
-                  _("%s is owned by %s, cannot add %s."),
-                  city_link(pcity),
-                  nation_plural_for_player(city_owner(pcity)),
-                  unit_link(punit));
     break;
   case UAB_TOO_BIG:
     notify_player(pplayer, ptile, E_BAD_COMMAND, ftc_server,


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

Reply via email to