Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2005:
[Freeciv-Dev] (PR#13621) AI bug (savegame)
Home

[Freeciv-Dev] (PR#13621) AI bug (savegame)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: himasaram@xxxxxxxx
Subject: [Freeciv-Dev] (PR#13621) AI bug (savegame)
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Wed, 17 Aug 2005 01:30:32 -0700
Reply-to: bugs@xxxxxxxxxxx

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

> [mstefek - Mon Aug 08 06:09:59 2005]:
> 
> > [himasaram@xxxxxxxx - Fri Aug 05 20:18:27 2005]:
> > 
> > Hi!
> > 
> > First of all, a huge thanks to the Freeciv team who have created this 
> > awesome piece of software!
> > 
> > Now, I have found a rather annoying bug playing the game: Peaceful AI 
> > players often send settlers into my homeland and found new cities 
> He is not peaceful, he is neutral.
> 
> > within my borders stealing territory. I've been told this behavior is a 
> > bug, so here's the relevant savegame. Within three turns the Malaysians 
> > will have founded a city in the south-west corner of "my" continent.
> > 
> > This game is played on Mac OS 10.3.9 with the Freeciv 2.0.3 official 
> > build.
> > 
> > Cheers
> > Daniel Markstedt
> > 
> I've debugged this savegame (the settlers unit id is 897) and find out
> the code which is responsible for the problem:
> 
> aisettler.c:489
> 
>     if (game.info.borders > 0
>         && ptile->owner != NULL
>         && ptile->owner != pplayer
>         && pplayers_in_peace(ptile->owner, pplayer)) {
>       /* Land theft does not make for good neighbours. */
>       continue;
>     }
> 
> So this doeasn't work for neutral players, which is the case in this
> savegame.
> 
Ok. Here's a patch
--
mateusz
Index: ai/aisettler.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aisettler.c,v
retrieving revision 1.28
diff -u -r1.28 aisettler.c
--- ai/aisettler.c      11 Aug 2005 02:22:48 -0000      1.28
+++ ai/aisettler.c      17 Aug 2005 08:20:07 -0000
@@ -489,7 +489,7 @@
     if (game.info.borders > 0
         && ptile->owner != NULL
         && ptile->owner != pplayer
-        && pplayers_in_peace(ptile->owner, pplayer)) {
+        && !pplayers_at_war(ptile->owner, pplayer)) {
       /* Land theft does not make for good neighbours. */
       continue;
     }

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