Complete.Org: Mailing Lists: Archives: freeciv-ai: June 2005:
[freeciv-ai] Re: [Freeciv-Dev] (PR#13227) foreign guard
Home

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

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [freeciv-ai] Re: [Freeciv-Dev] (PR#13227) foreign guard
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sat, 11 Jun 2005 11:22:10 -0700
Reply-to: bugs@xxxxxxxxxxx

<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

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);
   }
 

[Prev in Thread] Current Thread [Next in Thread]