Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] (PR#7324) orders and AI goto conflict
Home

[Freeciv-Dev] (PR#7324) orders and AI goto conflict

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#7324) orders and AI goto conflict
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 26 Jan 2004 12:20:39 -0800
Reply-to: rt@xxxxxxxxxxx

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

> [jdorje - Mon Jan 26 19:42:43 2004]:
> 
> If you use orders and AI goto at the same time, you have problems.

This patch may fix the problem.  Possibly.

jason

Index: ai/aitools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aitools.c,v
retrieving revision 1.96
diff -u -r1.96 aitools.c
--- ai/aitools.c        2003/11/28 17:37:18     1.96
+++ ai/aitools.c        2004/01/26 20:19:00
@@ -429,6 +429,12 @@
   struct unit *charge = find_unit_by_id(punit->ai.charge);
   struct unit *bodyguard = find_unit_by_id(punit->ai.bodyguard);
 
+  if (unit_has_orders(punit)) {
+    /* If the unit has client orders (from a human user attached to the
+     * AI player), get rid of them. */
+    free_unit_orders(punit);
+  }
+
   /* Free our ferry.  Most likely it has been done already. */
   if (task == AIUNIT_NONE || task == AIUNIT_DEFEND_HOME) {
     ai_clear_ferry(punit);

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