(PR#10941) AI builds cities inside territory of it's allies
"Mateusz Stefek" <mstefek-IjDXvh/[email protected]>
| Newsgroups | gmane.games.freeciv.ai |
|---|---|
| Message-ID | <[email protected]> |
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10941 > http://forum.freeciv.org/viewtopic.php?t=473 This patch should prevent it. Not really tested -- mateusz
dont_build_cities_near_allies.diff
(text/x-patch, 626 B)
Index: aisettler.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aisettler.c,v
retrieving revision 1.7.2.2
diff -u -r1.7.2.2 aisettler.c
--- aisettler.c 30 Oct 2004 15:58:03 -0000 1.7.2.2
+++ aisettler.c 8 Nov 2004 16:03:30 -0000
@@ -394,6 +394,15 @@
}
} square_iterate_end;
+ square_iterate(ptile, 2, tile1) {
+ if (tile1->city) {
+ if (pplayer != city_owner(tile1->city)
+ && pplayers_allied(pplayer, city_owner(tile1->city))) {
+ return;
+ }
+ }
+ } square_iterate_end;
+
if (enemies_at(punit, ptile)) {
return;
}