Re: [Freeciv-Dev] (PR#13227) foreign guard

"Per I. Mathisen" <per-0/[email protected]> Sat, 11 Jun 2005 11:22:10 -0700
Newsgroups gmane.games.freeciv.ai
Message-ID <[email protected]>
This is a multi-part message in MIME format...

------------=_1118514129-18827-0
Content-Type: text/plain; charset="utf-8"


<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13227 >

On Tue, 7 Jun 2005, Jason Short wrote:
> 1: Caesar's Cavalry[1964] (Idle) (32,19)->(-1,-1){1298,0} foreign guard
>
> Run the attached autogame until 1770, using CVS from "Tue Jun7
> 17:40:35 UTC 2005".

Attached patch (untested) should fix this.

Benedict: Can you look at this?

  - Per


------------=_1118514129-18827-0
Content-Type: text/plain; charset="US-ASCII"; name="fix13227.diff"
Content-Disposition: inline; filename="fix13227.diff"
Content-Transfer-Encoding: 7bit

Index: ai/aiguard.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aiguard.c,v
retrieving revision 1.1
diff -u -r1.1 aiguard.c
--- ai/aiguard.c	7 May 2005 13:35:25 -0000	1.1
+++ ai/aiguard.c	11 Jun 2005 18:21:08 -0000
@@ -276,12 +276,8 @@
     guard->ai.charge = BODYGUARD_NONE;
     BODYGUARD_LOG(LOGLEVEL_BODYGUARD, guard, "charge was destroyed");
   }
-  if (charge_owner && pplayers_at_war(charge_owner, guard_owner)) {
-    BODYGUARD_LOG(LOGLEVEL_BODYGUARD, guard, "charge became an enemy");
-    aiguard_clear_charge(guard);
-  } else if (charge_owner && charge_owner != guard_owner
-             && !pplayers_allied(charge_owner, guard_owner)) {
-    BODYGUARD_LOG(LOGLEVEL_BODYGUARD, guard, "charge is not allied");
+  if (charge_owner && charge_owner != guard_owner)) {
+    BODYGUARD_LOG(LOGLEVEL_BODYGUARD, guard, "charge transferred, dismiss");
     aiguard_clear_charge(guard);
   }
 

------------=_1118514129-18827-0--