From be2b46d4afd1bcf2c1702b7e0bbdc66fb2b28da4 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Thu, 18 Feb 2021 12:25:59 +0100 Subject: [PATCH] A paratroopers_range = 0 unit can't paradrop. The autohelp will say that a unit can perform the action "Paradrop Unit" even if its paratroopers_range is 0. This bug was hidden in the bundled rulesets since they require that a unit must have the Paratroopers unit type flag to do "Paradrop Unit". See osdn #41599 --- common/actions.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/actions.c b/common/actions.c index 5d6e060dfc..4a98afb85d 100644 --- a/common/actions.c +++ b/common/actions.c @@ -1867,6 +1867,12 @@ action_actor_utype_hard_reqs_ok(const action_id wanted_action, } break; + case ACTION_PARADROP: + if (actor_unittype->paratroopers_range <= 0) { + /* Reason: Can't pardrop 0 tiles. */ + return FALSE; + } + case ACTION_ESTABLISH_EMBASSY: case ACTION_ESTABLISH_EMBASSY_STAY: case ACTION_SPY_INVESTIGATE_CITY: @@ -1903,7 +1909,6 @@ action_actor_utype_hard_reqs_ok(const action_id wanted_action, case ACTION_RECYCLE_UNIT: case ACTION_DISBAND_UNIT: case ACTION_HOME_CITY: - case ACTION_PARADROP: case ACTION_AIRLIFT: case ACTION_CONQUER_CITY: case ACTION_HEAL_UNIT: -- 2.20.1