Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10481)
Home

[Freeciv-Dev] (PR#10481)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10481)
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sat, 9 Oct 2004 11:12:05 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10481 >

Diplomats in cvs head to not die when doing a mission. They should. This
is one of the main differences between the F_DIPLOMAT and F_SPY flags.

I am no sure how/when this got screwed up. Patch attached.

  - Per
Index: server/diplomats.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/diplomats.c,v
retrieving revision 1.61
diff -u -r1.61 diplomats.c
--- server/diplomats.c  29 Sep 2004 02:24:23 -0000      1.61
+++ server/diplomats.c  9 Oct 2004 18:06:18 -0000
@@ -1235,13 +1235,14 @@
   This determines if a diplomat/spy survives and escapes.
   If "pcity" is NULL, assume action was in the field.
 
-  - Spies and Diplomats have a game.diplchance specified chance of 
-    survival (better if veteran):
+  Spies have a game.diplchance specified chance of survival (better 
+  if veteran):
+    - Diplomats always die.
     - Escapes to home city.
     - Escapee may become a veteran.
 **************************************************************************/
-static void diplomat_escape (struct player *pplayer, struct unit *pdiplomat,
-                     struct city *pcity)
+static void diplomat_escape(struct player *pplayer, struct unit *pdiplomat,
+                            struct city *pcity)
 {
   struct tile *ptile;
   int escapechance;
@@ -1258,8 +1259,9 @@
   
   /* find closest city for escape target */
   spyhome = find_closest_owned_city(unit_owner(pdiplomat), ptile, FALSE, NULL);
-      
-  if (spyhome 
+
+  if (spyhome
+      && unit_flag(pdiplomat, F_SPY)
       && (myrand (100) < escapechance || unit_flag(pdiplomat, F_SUPERSPY))) {
     /* Attacking Spy/Diplomat survives. */
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10481), Per I. Mathisen <=