Author: sveinung
Date: Wed Apr  5 16:24:18 2017
New Revision: 35204

URL: http://svn.gna.org/viewcvs/freeciv?rev=35204&view=rev
Log:
Diplrel action cache: non hostile isn't hostile.

Stop the diplrel utype action cache from saying that a diplrel allows a
hostile action when it allows a non hostile action.

See hrm Bug #649816

Modified:
    branches/S3_0/common/unittype.c

Modified: branches/S3_0/common/unittype.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/common/unittype.c?rev=35204&r1=35203&r2=35204&view=diff
==============================================================================
--- branches/S3_0/common/unittype.c     (original)
+++ branches/S3_0/common/unittype.c     Wed Apr  5 16:24:18 2017
@@ -471,9 +471,11 @@
           BV_SET(dipl_rel_action_cache[putype_id][enabler->action],
                  requirement_diplrel_ereq(req.source.value.diplrel,
                                           REQ_RANGE_LOCAL, TRUE));
-          BV_SET(dipl_rel_action_cache[putype_id][ACTION_HOSTILE],
-                 requirement_diplrel_ereq(req.source.value.diplrel,
-                                          REQ_RANGE_LOCAL, TRUE));
+          if (action_is_hostile(enabler->action)) {
+            BV_SET(dipl_rel_action_cache[putype_id][ACTION_HOSTILE],
+                   requirement_diplrel_ereq(req.source.value.diplrel,
+                                            REQ_RANGE_LOCAL, TRUE));
+          }
           BV_SET(dipl_rel_action_cache[putype_id][ACTION_ANY],
                  requirement_diplrel_ereq(req.source.value.diplrel,
                                           REQ_RANGE_LOCAL, TRUE));
@@ -484,9 +486,11 @@
           BV_SET(dipl_rel_action_cache[putype_id][enabler->action],
               requirement_diplrel_ereq(req.source.value.diplrel,
                                        REQ_RANGE_LOCAL, FALSE));
-          BV_SET(dipl_rel_action_cache[putype_id][ACTION_HOSTILE],
-              requirement_diplrel_ereq(req.source.value.diplrel,
-                                       REQ_RANGE_LOCAL, FALSE));
+          if (action_is_hostile(enabler->action)) {
+            BV_SET(dipl_rel_action_cache[putype_id][ACTION_HOSTILE],
+                   requirement_diplrel_ereq(req.source.value.diplrel,
+                                            REQ_RANGE_LOCAL, FALSE));
+          }
           BV_SET(dipl_rel_action_cache[putype_id][ACTION_ANY],
               requirement_diplrel_ereq(req.source.value.diplrel,
                                        REQ_RANGE_LOCAL, FALSE));


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

Reply via email to