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

[Freeciv-Dev] (PR#10793) Barracks AI bug

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10793) Barracks AI bug
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sat, 30 Oct 2004 06:58:24 -0700
Reply-to: rt@xxxxxxxxxxx

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

The AI will not build Barracks (or Port) before building units because of
a pretty bad bug. The attached patch fixes this. Will be committed at
once.

  - Per

Index: ai/advmilitary.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advmilitary.c,v
retrieving revision 1.175
diff -u -r1.175 advmilitary.c
--- ai/advmilitary.c    25 Oct 2004 02:03:46 -0000      1.175
+++ ai/advmilitary.c    30 Oct 2004 13:56:53 -0000
@@ -979,7 +979,7 @@
   struct tile *ptile;
   /* Our transport */
   struct unit *ferryboat = NULL;
-  /* Out target */
+  /* Our target */
   struct city *acity;
   /* Defender of the target city/tile */
   struct unit *pdef; 
@@ -1124,9 +1124,9 @@
   }
 
   if (best_choice.want > choice->want) {
-    /* We want attacker more that what we have selected before */
+    /* We want attacker more than what we have selected before */
     copy_if_better_choice(&best_choice, choice);
-    freelog(LOG_DEBUG, "%s has chosen attacker, %s, want=%d",
+    CITY_LOG(LOG_DEBUG, pcity, "ksw: %s has chosen attacker, %s, want=%d",
             pcity->name, unit_types[choice->choice].name, choice->want);
 
     if (go_by_boat && !ferryboat) { /* need a new ferry */
@@ -1190,7 +1190,7 @@
   Impr_Type_id id;
 
   /* Sanity */
-  if (!is_unit_choice_type(choice->choice)) return;
+  if (!is_unit_choice_type(choice->type)) return;
   if (unit_type_flag(choice->choice, F_NONMIL)) return;
   if (do_make_unit_veteran(pcity, choice->choice)) return;
 

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