Complete.Org: Mailing Lists: Archives: freeciv-ai: February 2003:
[freeciv-ai] (PR#3508) coordinate handling fix in ai_military_gothere
Home

[freeciv-ai] (PR#3508) coordinate handling fix in ai_military_gothere

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [freeciv-ai] (PR#3508) coordinate handling fix in ai_military_gothere
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 27 Feb 2003 15:19:33 -0800
Reply-to: rt@xxxxxxxxxxxxxx

The applied portion of the patch fixes the bug in the code.  Note it is
a bug: it can cause units to promptly try to charge off toward (0,0) for
no reason.

The remainder of the patch is for debugging.  We should use (-1,-1)
instead of (0,0) to make sure that the uninitialized coordinates are
never used.  Obviously, this has a lower priority than the first part did.

jason

Index: ai/aiunit.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aiunit.c,v
retrieving revision 1.267
diff -u -r1.267 aiunit.c
--- ai/aiunit.c 2003/02/27 22:28:41     1.267
+++ ai/aiunit.c 2003/02/27 23:18:34
@@ -1307,7 +1307,7 @@
 static int ai_military_gothere(struct player *pplayer, struct unit *punit,
                               int dest_x, int dest_y)
 {
-  int id, x, y, boatid = 0, bx = 0, by = 0;
+  int id, x, y, boatid = 0, bx = -1, by = -1;
   struct unit *ferryboat;
   struct unit *def;
   struct city *dcity;

[Prev in Thread] Current Thread [Next in Thread]
  • [freeciv-ai] (PR#3508) coordinate handling fix in ai_military_gothere, Jason Short <=