Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2006:
[Freeciv-Dev] (PR#15325) ai military advice is pretty bad
Home

[Freeciv-Dev] (PR#15325) ai military advice is pretty bad

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#15325) ai military advice is pretty bad
From: "Mike Kaufman" <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 28 Jan 2006 19:50:24 -0800
Reply-to: bugs@xxxxxxxxxxx

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

Here's a little buglet. It seemed that the AI kept building airports. A lot
of airports. Airports in cities that already had airports.

Attached is the fix. Note that I really don't like this function. Is it
really necessary that every single city that an AI owns should build an
airport?

-mike

Index: ai/advmilitary.c
===================================================================
--- ai/advmilitary.c    (revision 11503)
+++ ai/advmilitary.c    (working copy)
@@ -1219,8 +1219,10 @@
 
   move_type = get_unit_type(choice->choice)->move_type;
 
-  /* TODO: separate checks based on other requirements (e.g., unit class) */
-  if ((id = ai_find_source_building(pplayer, EFT_VETERAN_BUILD)) != B_LAST) {
+  /* TODO: separate checks based on other requirements (e.g., unit class) 
+   *  N.B.: have to check that we haven't already built the building --mck */
+  if ((id = ai_find_source_building(pplayer, EFT_VETERAN_BUILD)) != B_LAST
+       && !city_got_building(pcity, id)) {
     choice->choice = id;
     choice->type = CT_BUILDING;
   }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#15325) ai military advice is pretty bad, Mike Kaufman <=