Author: sveinung
Date: Thu Jul 30 12:23:23 2015
New Revision: 29268

URL: http://svn.gna.org/viewcvs/freeciv?rev=29268&view=rev
Log:
Remove custom wrong unit type explanation for join city

The system that explains why an action is illegal can now detect if the
actor unit never were able to do the action in the first place.

See patch #6149

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=29268&r1=29267&r2=29268&view=diff
==============================================================================
--- trunk/common/unit.c (original)
+++ trunk/common/unit.c Thu Jul 30 12:23:23 2015
@@ -387,7 +387,6 @@
   struct tile *ptile = unit_tile(punit);
   struct city *pcity = tile_city(ptile);
   bool is_build = unit_is_cityfounder(punit);
-  bool is_add = unit_can_do_action(punit, ACTION_JOIN_CITY);
   int new_pop;
 
   /* Test if we can build. */
@@ -409,11 +408,6 @@
     }
     log_error("%s(): Internal error.", __FUNCTION__);
     return UAB_BAD_CITY_TERRAIN; /* Returns something prohibitive. */
-  }
-
-  /* Test if we can add. */
-  if (!is_add) {
-    return UAB_NOT_ADDABLE_UNIT;
   }
 
   fc_assert(unit_pop_value(punit) > 0);

Modified: trunk/common/unit.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/unit.h?rev=29268&r1=29267&r2=29268&view=diff
==============================================================================
--- trunk/common/unit.h (original)
+++ trunk/common/unit.h Thu Jul 30 12:23:23 2015
@@ -60,7 +60,6 @@
   UAB_BAD_UNIT_TERRAIN, /* Equivalent to 'CB_BAD_UNIT_TERRAIN'. */
   UAB_BAD_BORDERS,      /* Equivalent to 'CB_BAD_BORDERS'. */
   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_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=29268&r1=29267&r2=29268&view=diff
==============================================================================
--- trunk/server/cityhand.c     (original)
+++ trunk/server/cityhand.c     Thu Jul 30 12:23:23 2015
@@ -90,7 +90,6 @@
     break;
 
   case UAB_ADD_OK:
-  case UAB_NOT_ADDABLE_UNIT:
   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=29268&r1=29267&r2=29268&view=diff
==============================================================================
--- trunk/server/unithand.c     (original)
+++ trunk/server/unithand.c     Thu Jul 30 12:23:23 2015
@@ -1797,22 +1797,6 @@
       } else {
         notify_player(pplayer, ptile, E_BAD_COMMAND, ftc_server,
                       _("Can't build a city."));
-      }
-    }
-    break;
-  case UAB_NOT_ADDABLE_UNIT:
-    {
-      struct astring astr = ASTRING_INIT;
-
-      if (role_units_translations(&astr, action_get_role(ACTION_JOIN_CITY),
-                                  TRUE)) {
-        notify_player(pplayer, ptile, E_BAD_COMMAND, ftc_server,
-                      /* TRANS: %s is list of units separated by "or". */
-                      _("Only %s can add to a city."), astr_str(&astr));
-        astr_free(&astr);
-      } else {
-        notify_player(pplayer, ptile, E_BAD_COMMAND, ftc_server,
-                      _("Can't add to a city."));
       }
     }
     break;


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

Reply via email to