Author: sveinung
Date: Wed Apr  5 16:26:30 2017
New Revision: 35208

URL: http://svn.gna.org/viewcvs/freeciv?rev=35208&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/S2_6/common/unittype.c

Modified: branches/S2_6/common/unittype.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/unittype.c?rev=35208&r1=35207&r2=35208&view=diff
==============================================================================
--- branches/S2_6/common/unittype.c     (original)
+++ branches/S2_6/common/unittype.c     Wed Apr  5 16:26:30 2017
@@ -454,9 +454,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));
@@ -467,9 +469,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