Author: sveinung
Date: Sun Aug 21 11:58:07 2016
New Revision: 33664

Fix action distance validation in Freeciv-web.

The "Paradrop Unit" action limits its distance to target tile via each unit
type's field paratroopers_range. The maximum distance of the "Paradrop Unit"
action was therefore set to the UNIT_MAX_PARADROP_RANGE, the highest value
the paratroopers_range field can have. UNIT_MAX_PARADROP_RANGE comes from
paratroopers_range being transferred as an unit16 in the network protocol.

Freeciv-web builds have different max map size constants. This influences
the maximum legal action max_distance so UNIT_MAX_PARADROP_RANGE becomes too

(This limits what rulesets a Freeciv-web build can load. Maybe we should
find another way to limit the map size on A general
"the server operator forbids the following server settings" system could
also be used by regular public Freeciv server operators.)

Set max distance for ACTION_PARADROP to the highest value it can have. The
unit type's paratroopers_range will still limit it.

See bug #24987


Modified: trunk/common/actions.c
--- trunk/common/actions.c      (original)
+++ trunk/common/actions.c      Sun Aug 21 11:58:07 2016
@@ -227,7 +227,7 @@
   actions[ACTION_PARADROP] =
       action_new(ACTION_PARADROP, ATK_TILE,
                  FALSE, FALSE, TRUE,
-                 1, UNIT_MAX_PARADROP_RANGE);
+                 1, MAP_DISTANCE_MAX);
   actions[ACTION_AIRLIFT] =
       action_new(ACTION_AIRLIFT, ATK_CITY,
                  FALSE, FALSE, TRUE,

Freeciv-commits mailing list

Reply via email to