(PR#10078) AIs often agress on cease fire just for one turn

"Mateusz Stefek" <mstefek-IjDXvh/[email protected]>
Newsgroups gmane.games.freeciv.ai
Message-ID <[email protected]>
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10078 >

> [mstefek - Fri Sep 17 18:26:12 2004]:
> 
> i suggest temporary fix for it:
>     if (aplayer->is_alive
>         && adip->at_war_with_ally
>         && !adip->is_allied_with_ally
>         && !pplayers_at_war(pplayer, aplayer) &&
>         && (diplomatic_state != DS_CEASEFIRE || myrand(5) < 1)) {
>              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>       notify(aplayer, _("*%s (AI)* Your aggression against my allies was "
> 			"your last mistake!"), pplayer->name);
>       ai_go_to_war(pplayer, ai, aplayer);
>     }
> 
> The player will have some time to sign a ceasefire with the rest of the
> alliance, before someone declares war again
> --
> mateusz
> 

Here's a patch
cease_fire_break_delay.diff (text/x-patch, 783 B)
? test
Index: advdiplomacy.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdiplomacy.c,v
retrieving revision 1.44
diff -u -r1.44 advdiplomacy.c
--- advdiplomacy.c	20 Sep 2004 22:06:52 -0000	1.44
+++ advdiplomacy.c	20 Sep 2004 22:13:25 -0000
@@ -1031,7 +1031,9 @@
     if (aplayer->is_alive
         && adip->at_war_with_ally
         && !adip->is_allied_with_ally
-        && !pplayers_at_war(pplayer, aplayer)) {
+        && !pplayers_at_war(pplayer, aplayer)
+	&& (pplayer_get_diplstate(pplayer, aplayer)->type != DS_CEASEFIRE || 
+	    myrand(5) < 1)) {
       notify(aplayer, _("*%s (AI)* Your aggression against my allies was "
 			"your last mistake!"), pplayer->name);
       ai_go_to_war(pplayer, ai, aplayer);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.