(PR#10561) Re: AI starts many wonders but never finishes any
"Per I. Mathisen" <per-0/[email protected]>
| Newsgroups | gmane.games.freeciv.ai |
|---|---|
| Message-ID | <[email protected]> |
<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
build1.diff
(text/x-patch, 536 B)
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;
}
wonder3.diff
(text/x-patch, 722 B)
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)