Author: sveinung
Date: Sat Oct  8 20:57:09 2016
New Revision: 34063

URL: http://svn.gna.org/viewcvs/freeciv?rev=34063&view=rev
Log:
Initialize the action of new action enablers.

Have action_enabler_new() set the action of the newly created enabler to a
known invalid value.

See bug #25157

Modified:
    branches/S2_6/common/actions.c
    branches/S2_6/common/actions.h

Modified: branches/S2_6/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/actions.c?rev=34063&r1=34062&r2=34063&view=diff
==============================================================================
--- branches/S2_6/common/actions.c      (original)
+++ branches/S2_6/common/actions.c      Sat Oct  8 20:57:09 2016
@@ -458,6 +458,10 @@
   requirement_vector_init(&enabler->actor_reqs);
   requirement_vector_init(&enabler->target_reqs);
 
+  /* Make sure that action doesn't end up as a random value that happens to
+   * be a valid action id. */
+  enabler->action = ACTION_NONE;
+
   return enabler;
 }
 

Modified: branches/S2_6/common/actions.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/actions.h?rev=34063&r1=34062&r2=34063&view=diff
==============================================================================
--- branches/S2_6/common/actions.h      (original)
+++ branches/S2_6/common/actions.h      Sat Oct  8 20:57:09 2016
@@ -74,6 +74,9 @@
 /* Used in searches to signal that any action at all is OK. */
 #define ACTION_ANY ACTION_COUNT
 
+/* Used to signal the absence of any actions. */
+#define ACTION_NONE ACTION_COUNT
+
 /* Used in the network protocol */
 #define SPECENUM_NAME action_proto_signal
 /* The player wants to be reminded to ask what actions the unit can perform


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

Reply via email to