Author: sveinung
Date: Wed Oct 19 14:21:13 2016
New Revision: 34179

URL: http://svn.gna.org/viewcvs/freeciv?rev=34179&view=rev
Log:
action_prob_vs_units(): distance is known.

An action is known to be impossible if the distance between actor and target
is out of the accepted range.

See bug #25196

Modified:
    trunk/common/actions.c

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=34179&r1=34178&r2=34179&view=diff
==============================================================================
--- trunk/common/actions.c      (original)
+++ trunk/common/actions.c      Wed Oct 19 14:21:13 2016
@@ -3083,6 +3083,13 @@
     return ACTPROB_IMPOSSIBLE;
   }
 
+  if (!action_id_distance_accepted(action_id,
+                                   real_map_distance(unit_tile(actor_unit),
+                                                     target_tile))) {
+    /* No point in continuing. */
+    return ACTPROB_IMPOSSIBLE;
+  }
+
   /* Do the player know if there are units at the tile? Must be done here
    * since an empthy unseen tile will result in false. */
   if (!can_player_see_hypotetic_units_at(unit_owner(actor_unit),


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to