Author: sveinung
Date: Thu Nov 27 15:29:49 2014
New Revision: 27136

URL: http://svn.gna.org/viewcvs/freeciv?rev=27136&view=rev
Log:
Assert that is_action_possible() is supplied with the correct target.

This is just for documentation. All paths that lead to it are already checked.

See patch #5463

Modified:
    trunk/common/actions.c

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=27136&r1=27135&r2=27136&view=diff
==============================================================================
--- trunk/common/actions.c      (original)
+++ trunk/common/actions.c      Thu Nov 27 15:29:49 2014
@@ -391,6 +391,12 @@
                               const struct output_type *target_output,
                               const struct specialist *target_specialist)
 {
+  fc_assert_msg((action_get_target_kind(wanted_action) == ATK_CITY
+                 && target_city != NULL)
+                || (action_get_target_kind(wanted_action) == ATK_UNIT
+                    && target_unit != NULL),
+                "Missing target!");
+
   if (action_get_actor_kind(wanted_action) == AAK_UNIT) {
     /* The Freeciv code for all actions controlled by enablers assumes that
      * an acting unit is on the same tile as its target or on the tile next


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

Reply via email to