From 8b41ecac1ec48552cda4668d6a66dadcf677895f Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Thu, 18 Feb 2021 12:25:44 +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 345a098e73..62e947126b 100644 --- a/common/actions.c +++ b/common/actions.c @@ -3024,6 +3024,12 @@ action_actor_utype_hard_reqs_ok_full(enum action_result result, } break; + case ACTRES_PARADROP: + if (actor_unittype->paratroopers_range <= 0) { + /* Reason: Can't pardrop 0 tiles. */ + return FALSE; + } + case ACTRES_ESTABLISH_EMBASSY: case ACTRES_SPY_INVESTIGATE_CITY: case ACTRES_SPY_POISON: @@ -3051,7 +3057,6 @@ action_actor_utype_hard_reqs_ok_full(enum action_result result, case ACTRES_RECYCLE_UNIT: case ACTRES_DISBAND_UNIT: case ACTRES_HOME_CITY: - case ACTRES_PARADROP: case ACTRES_AIRLIFT: case ACTRES_STRIKE_BUILDING: case ACTRES_STRIKE_PRODUCTION: -- 2.20.1