Author: sveinung
Date: Tue Jan  6 12:42:51 2015
New Revision: 27551

URL: http://svn.gna.org/viewcvs/freeciv?rev=27551&view=rev
Log:
Only cache a unit type's ability to do actions with a unit actor.

See patch #5667

Modified:
    trunk/common/unittype.c

Modified: trunk/common/unittype.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/unittype.c?rev=27551&r1=27550&r2=27551&view=diff
==============================================================================
--- trunk/common/unittype.c     (original)
+++ trunk/common/unittype.c     Tue Jan  6 12:42:51 2015
@@ -290,7 +290,8 @@
    * enablers */
   action_enablers_iterate(enabler) {
     if (requirement_fulfilled_by_unit_type(putype,
-                                           &(enabler->actor_reqs))) {
+                                           &(enabler->actor_reqs))
+        && action_get_actor_kind(enabler->action) == AAK_UNIT) {
       log_debug("act_cache: %s can %s",
                 utype_rule_name(putype), gen_action_name(enabler->action));
       BV_SET(unit_can_act_cache[enabler->action], utype_index(putype));
@@ -386,7 +387,8 @@
      * implies or conflicts with another so the tests can be simple. */
     action_enablers_iterate(enabler) {
       if (requirement_fulfilled_by_unit_type(putype,
-                                             &(enabler->actor_reqs))) {
+                                             &(enabler->actor_reqs))
+          && action_get_actor_kind(enabler->action) == AAK_UNIT) {
         /* Not required to be absent, so OK if present */
         req.present = FALSE;
         if (!is_req_in_vec(&req, &(enabler->actor_reqs))) {
@@ -448,7 +450,8 @@
      * relationship property value. */
     action_enablers_iterate(enabler) {
       if (requirement_fulfilled_by_unit_type(putype,
-                                             &(enabler->actor_reqs))) {
+                                             &(enabler->actor_reqs))
+          && action_get_actor_kind(enabler->action) == AAK_UNIT) {
         req.present = TRUE;
         if (!does_req_contradicts_reqs(&req, &(enabler->actor_reqs))) {
           BV_SET(dipl_rel_action_cache[putype_id][enabler->action],


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

Reply via email to