Complete.Org: Mailing Lists: Archives: freeciv-ai: September 2004:
[freeciv-ai] (PR#10078) AIs often agress on cease fire just for one turn
Home

[freeciv-ai] (PR#10078) AIs often agress on cease fire just for one turn

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [freeciv-ai] (PR#10078) AIs often agress on cease fire just for one turn
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Mon, 20 Sep 2004 15:14:00 -0700
Reply-to: rt@xxxxxxxxxxx

<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
? 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);

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