(PR#14053) naive AI and ceasefire

"Mateusz Stefek" <mstefek-IjDXvh/[email protected]> Tue, 20 Sep 2005 06:30:42 -0700
Newsgroups gmane.games.freeciv.ai
Message-ID <[email protected]>
This is a multi-part message in MIME format...

------------=_1127223042-11295-2
Content-Type: text/plain; charset="utf-8"


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

> [mstefek - Tue Sep 20 13:14:55 2005]:
> 
> Often when I have ceasefire with the AI, I break it to take some empty
> cities then I ask for ceasefire in the same turn. AI accepts. I can do
> this many times. Seems that such behaviour doesn't affect AI's attitude.
> AI is still neutral towards me after many tries.

The bug is a simple mistake in ai_incident_war().
--
mateusz

------------=_1127223042-11295-2
Content-Type: text/x-patch; charset="ascii"; name="ai_incident_war.diff"
Content-Disposition: inline; filename="ai_incident_war.diff"
Content-Transfer-Encoding: 7bit

Index: advdiplomacy.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdiplomacy.c,v
retrieving revision 1.91
diff -u -r1.91 advdiplomacy.c
--- advdiplomacy.c	8 Sep 2005 19:51:23 -0000	1.91
+++ advdiplomacy.c	20 Sep 2005 13:28:27 -0000
@@ -1593,7 +1593,7 @@
         pplayer->ai.love[violator->player_no] -= MAX_AI_LOVE / 10;
       }
       if (victim == pplayer) {
-        pplayer->ai.love[violator->player_no] -= 
+        pplayer->ai.love[violator->player_no] = 
           MIN(pplayer->ai.love[violator->player_no] - MAX_AI_LOVE / 3, -1);
         /* Scream for help!! */
         players_iterate(ally) {

------------=_1127223042-11295-2--