From b6254a845c80fd6e0d3d18eceac4b23aa8a1ab9f Mon Sep 17 00:00:00 2001
From: Sveinung Kvilhaugsvik <sveinung84@users.sourceforge.net>
Date: Thu, 18 Feb 2021 12:25:59 +0100
Subject: [PATCH 1/2] 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 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/common/actions.c b/common/actions.c
index 5d6e060dfc..acc9f00fba 100644
--- a/common/actions.c
+++ b/common/actions.c
@@ -1867,6 +1867,13 @@ 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;
+    }
+    break;
+
   case ACTION_ESTABLISH_EMBASSY:
   case ACTION_ESTABLISH_EMBASSY_STAY:
   case ACTION_SPY_INVESTIGATE_CITY:
@@ -1903,7 +1910,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