Complete.Org: Mailing Lists: Archives: freeciv-ai: October 2004:
[freeciv-ai] (PR#10561) Re: AI starts many wonders but never finishes an
Home

[freeciv-ai] (PR#10561) Re: AI starts many wonders but never finishes an

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: dj67@xxxxxxxxxxxxxxxx, jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [freeciv-ai] (PR#10561) Re: AI starts many wonders but never finishes any
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sat, 30 Oct 2004 09:32:44 -0700
Reply-to: rt@xxxxxxxxxxx

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

Further two improvements. The first (build1.diff) fixes a serious bug,
the other (wonder3.diff) makes human players' AI advisor never suggest
wonders or palace.

  - Per
Index: server/cityturn.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/cityturn.c,v
retrieving revision 1.270
diff -u -r1.270 cityturn.c
--- server/cityturn.c   30 Oct 2004 16:13:01 -0000      1.270
+++ server/cityturn.c   30 Oct 2004 16:31:23 -0000
@@ -580,6 +580,7 @@
     if (can_build_improvement(pcity, i)
        && !building_has_effect(i, EFT_CAPITAL_CITY)) {
       change_build_target(pplayer, pcity, i, FALSE, E_IMP_AUTO);
+      return;
     }
   } impr_type_iterate_end;
 }
Index: ai/aitools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aitools.c,v
retrieving revision 1.126
diff -u -r1.126 aitools.c
--- ai/aitools.c        29 Sep 2004 02:24:18 -0000      1.126
+++ ai/aitools.c        30 Oct 2004 16:31:31 -0000
@@ -723,6 +723,11 @@
   city_list_iterate_end;
 
   impr_type_iterate(i) {
+    if (!plr->ai.control
+        && (get_building_for_effect(EFT_CAPITAL_CITY) == i
+            || is_wonder(i))) {
+      continue; /* Humans should not be advised to build wonders or palace */
+    }
     if (!is_wonder(i)
        || (!pcity->is_building_unit && is_wonder(pcity->currently_building)
            && pcity->shield_stock >= impr_build_shield_cost(i) / 2)

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