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

 My ruleset has pop_cost 2 for settlers. So city has to have at least
size 3 in order to build settlers. When new city starts building
settlers immediately, it gets enough shields far before city grows to
size 3. Instead it should build something useful first.
 Attached patch changes AI so that it does not start building settlers
before city is only one step from size required to build settlers. So
for pop_cost = 1, any city may start building settlers (minimum size
is 1). For pop_cost = 2, only cities of size 2 or higher start
building settlers.


 - ML

diff -Nurd -X.diff_ignore freeciv/ai/advdomestic.c freeciv/ai/advdomestic.c
--- freeciv/ai/advdomestic.c	2006-07-17 23:56:47.000000000 +0300
+++ freeciv/ai/advdomestic.c	2007-01-28 14:41:37.000000000 +0200
@@ -277,7 +277,8 @@
       && (pcity->id != ai->wonder_city
           || unit_type->pop_cost == 0)
       && pcity->surplus[O_FOOD] >= utype_upkeep_cost(unit_type,
-                                                     pplayer, O_FOOD)) {
+                                                     pplayer, O_FOOD)
+      && pcity->size >= unit_pop_value(unit_type)) {
     /* founder_want calculated in aisettlers.c */
     int want = pcity->ai.founder_want;
 
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to