Author: sveinung
Date: Fri May 22 12:40:58 2015
New Revision: 29121

URL: http://svn.gna.org/viewcvs/freeciv?rev=29121&view=rev
Log:
Remove custom no moves left handling for city founding and joining.

See patch #6097

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=29121&r1=29120&r2=29121&view=diff
==============================================================================
--- trunk/common/unit.c (original)
+++ trunk/common/unit.c Fri May 22 12:40:58 2015
@@ -395,14 +395,6 @@
     if (!is_build) {
       return UAB_NOT_BUILD_UNIT;
     }
-    if (punit->moves_left == 0
-        /* TODO: Remove UAB_NO_MOVES_BUILD when doing so is safe. */
-        /* The ruleset may allow founding cities when out of move
-         * fragments. */
-        && !utype_may_act_move_frags(unit_type(punit),
-                                     ACTION_FOUND_CITY, 0)) {
-      return UAB_NO_MOVES_BUILD;
-    }
     switch (city_build_here_test(ptile, punit)) {
     case CB_OK:
       return UAB_BUILD_OK;
@@ -416,20 +408,12 @@
       return UAB_NO_MIN_DIST;
     }
     log_error("%s(): Internal error.", __FUNCTION__);
-    return UAB_NO_MOVES_BUILD; /* Returns something prohibitive. */
+    return UAB_BAD_CITY_TERRAIN; /* Returns something prohibitive. */
   }
 
   /* Test if we can add. */
   if (!is_add) {
     return UAB_NOT_ADDABLE_UNIT;
-  }
-  if (punit->moves_left == 0
-      /* TODO: Remove UAB_NO_MOVES_ADD when doing so is safe. */
-      /* The ruleset may allow joining cities when out of move
-       * fragments. */
-      && !utype_may_act_move_frags(unit_type(punit),
-                                   ACTION_JOIN_CITY, 0)) {
-    return UAB_NO_MOVES_ADD;
   }
 
   fc_assert(unit_pop_value(punit) > 0);

Modified: trunk/common/unit.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/unit.h?rev=29121&r1=29120&r2=29121&view=diff
==============================================================================
--- trunk/common/unit.h (original)
+++ trunk/common/unit.h Fri May 22 12:40:58 2015
@@ -62,8 +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_NO_MOVES_BUILD,   /* Unit does not have moves left to build a city. */
-  UAB_NO_MOVES_ADD,     /* Unit does not have moves left to add to city. */
   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=29121&r1=29120&r2=29121&view=diff
==============================================================================
--- trunk/server/cityhand.c     (original)
+++ trunk/server/cityhand.c     Fri May 22 12:40:58 2015
@@ -84,7 +84,6 @@
   case UAB_BAD_BORDERS:
   case UAB_NO_MIN_DIST:
   case UAB_NOT_BUILD_UNIT:
-  case UAB_NO_MOVES_BUILD:
     log_verbose("handle_city_name_suggest_req(unit_pos (%d, %d)): "
                 "cannot build there.", TILE_XY(unit_tile(punit)));
     city_add_or_build_error(pplayer, punit, res);       /* Message. */
@@ -92,7 +91,6 @@
 
   case UAB_ADD_OK:
   case UAB_NOT_ADDABLE_UNIT:
-  case UAB_NO_MOVES_ADD:
   case UAB_NOT_OWNER:
   case UAB_TOO_BIG:
   case UAB_NO_SPACE:

Modified: trunk/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=29121&r1=29120&r2=29121&view=diff
==============================================================================
--- trunk/server/unithand.c     (original)
+++ trunk/server/unithand.c     Fri May 22 12:40:58 2015
@@ -1639,16 +1639,6 @@
                       _("Can't add to a city."));
       }
     }
-    break;
-  case UAB_NO_MOVES_ADD:
-    notify_player(pplayer, ptile, E_BAD_COMMAND, ftc_server,
-                  _("%s unit has no moves left to add to %s."),
-                  unit_link(punit), city_link(pcity));
-    break;
-  case UAB_NO_MOVES_BUILD:
-    notify_player(pplayer, ptile, E_BAD_COMMAND, ftc_server,
-                  _("%s unit has no moves left to build city."),
-                  unit_link(punit));
     break;
   case UAB_NOT_OWNER:
     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