[freeciv-ai] (PR#13430)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13430 >
OOps.
- if (ai->max_num_cities >= city_list_size(pplayer->cities)) {
+ if (ai->max_num_cities <= city_list_size(pplayer->cities)) {
This patch also fixes a problem with AI-only games.
--
mateusz
Index: ai/advdomestic.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdomestic.c,v
retrieving revision 1.133
diff -u -r1.133 advdomestic.c
--- ai/advdomestic.c 7 Jul 2005 08:34:33 -0000 1.133
+++ ai/advdomestic.c 9 Jul 2005 09:39:12 -0000
@@ -189,7 +189,7 @@
want /= 5;
}
- if (ai->max_num_cities >= city_list_size(pplayer->cities)) {
+ if (ai->max_num_cities <= city_list_size(pplayer->cities)) {
want /= 100;
}
Index: ai/aidata.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aidata.c,v
retrieving revision 1.71
diff -u -r1.71 aidata.c
--- ai/aidata.c 7 Jul 2005 08:34:33 -0000 1.71
+++ ai/aidata.c 9 Jul 2005 09:39:14 -0000
@@ -694,14 +694,19 @@
* for the beginners.
*/
if (ai_handicap(pplayer, H_EXPANSION)) {
+ bool found_human = FALSE;
ai->max_num_cities = 3;
players_iterate(aplayer) {
- if (aplayer == pplayer || aplayer->ai.control) {
+ if (aplayer == pplayer || aplayer->ai.control || !aplayer->is_alive) {
continue;
}
ai->max_num_cities = MAX(ai->max_num_cities,
city_list_size(aplayer->cities) + 3);
+ found_human = TRUE;
} players_iterate_end;
+ if (!found_human) {
+ ai->max_num_cities = MAP_INDEX_SIZE;
+ }
} else {
ai->max_num_cities = MAP_INDEX_SIZE;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freeciv-ai] (PR#13430),
Mateusz Stefek <=
|
|