Author: sveinung
Date: Sun Feb 21 22:12:51 2016
New Revision: 32012

URL: http://svn.gna.org/viewcvs/freeciv?rev=32012&view=rev
Log:
Explain no "Paradrop Unit" while transporting.

Explain when the "Paradrop Unit" action can't be performed because the actor
unit is transporting another unit.

See patch #6983

Modified:
    trunk/common/actions.c
    trunk/server/unithand.c
    trunk/server/unittools.c

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=32012&r1=32011&r2=32012&view=diff
==============================================================================
--- trunk/common/actions.c      (original)
+++ trunk/common/actions.c      Sun Feb 21 22:12:51 2016
@@ -1392,8 +1392,12 @@
       return TRI_NO;
     }
 
-    /* Reason: Keep the old rules. */
+    /* Reason: The paradrop code doesn't check if transported units can
+     * coexist with the target tile city and units. */
     /* Info leak: The player knows if his unit is transporting a unit. */
+    /* This hard coded limitation is detected in the action not enabled
+     * explanation code. Remember to remove it too if this hard coded
+     * limitation moves to the ruleset. */
     if (get_transporter_occupancy(actor_unit) > 0) {
       return TRI_NO;
     }

Modified: trunk/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=32012&r1=32011&r2=32012&view=diff
==============================================================================
--- trunk/server/unithand.c     (original)
+++ trunk/server/unithand.c     Sun Feb 21 22:12:51 2016
@@ -745,6 +745,10 @@
   } else if (0 < get_transporter_occupancy(punit)
              && !utype_can_do_act_when_ustate(unit_type_get(punit), action_id,
                                               USP_TRANSPORTING, TRUE)) {
+    expl->kind = ANEK_IS_TRANSPORTING;
+  } else if (action_id == ACTION_PARADROP
+             && 0 < get_transporter_occupancy(punit)) {
+    /* Hard action requirement. */
     expl->kind = ANEK_IS_TRANSPORTING;
   } else if (!(0 < get_transporter_occupancy(punit))
              && !utype_can_do_act_when_ustate(unit_type_get(punit), action_id,

Modified: trunk/server/unittools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unittools.c?rev=32012&r1=32011&r2=32012&view=diff
==============================================================================
--- trunk/server/unittools.c    (original)
+++ trunk/server/unittools.c    Sun Feb 21 22:12:51 2016
@@ -2733,14 +2733,6 @@
   struct player *pplayer = unit_owner(punit);
   int range, distance;
 
-  if (get_transporter_occupancy(punit) > 0) {
-    /* TODO: Explain using the action not enabled system and remove. */
-    notify_player(pplayer, unit_tile(punit), E_BAD_COMMAND, ftc_server,
-                  _("You cannot paradrop a unit that is "
-                    "transporting other units."));
-    return FALSE;
-  }
-
   if (!map_is_known(ptile, pplayer)) {
     /* TODO: Explain using the action not enabled system and remove. */
     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