Author: sveinung
Date: Fri Oct 23 13:40:05 2015
New Revision: 30182

URL: http://svn.gna.org/viewcvs/freeciv?rev=30182&view=rev
Log:
Abort some actions on domestic target

Have the action doer functions responsible for gold theft, city inciting
and unit bribery abort if the target is domestic.

Note that the functions currently aren't called with domestic targets
because doing so is against the hard coded rules.

See patch #6465

Modified:
    branches/S2_6/server/diplomats.c

Modified: branches/S2_6/server/diplomats.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/diplomats.c?rev=30182&r1=30181&r2=30182&view=diff
==============================================================================
--- branches/S2_6/server/diplomats.c    (original)
+++ branches/S2_6/server/diplomats.c    Fri Oct 23 13:40:05 2015
@@ -440,6 +440,12 @@
     return;
   }
 
+  /* Sanity check: The target is foreign. */
+  if (uplayer == pplayer) {
+    /* Nothing to do to a domestic target. */
+    return;
+  }
+
   /* Sanity check: The victim isn't a unique unit the actor player already
    * has. */
   if (utype_player_already_has_this_unique(pplayer,
@@ -741,6 +747,12 @@
 
   /* Sanity check: The actor still exists. */
   if (!pplayer || !pdiplomat || !unit_alive(pdiplomat->id)) {
+    return;
+  }
+
+  /* Sanity check: The target is foreign. */
+  if (cplayer == pplayer) {
+    /* Nothing to do to a domestic target. */
     return;
   }
 
@@ -1130,6 +1142,12 @@
 
   /* Sanity check: The target player still exists. */
   if (!tgt_player) {
+    return;
+  }
+
+  /* Sanity check: The target is foreign. */
+  if (tgt_player == act_player) {
+    /* Nothing to do to a domestic target. */
     return;
   }
 


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

Reply via email to