Complete.Org: Mailing Lists: Archives: freeciv-ai: September 2004:
[freeciv-ai] (PR#9920) Wrong use of pplayers_non_attack in ai_diplomacy_
Home

[freeciv-ai] (PR#9920) Wrong use of pplayers_non_attack in ai_diplomacy_

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [freeciv-ai] (PR#9920) Wrong use of pplayers_non_attack in ai_diplomacy_calculate
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Fri, 3 Sep 2004 08:28:36 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9920 >

It halves war desire only for pplayers with whom we have peace or
ceasefire. (players_non_attack() returns _FALSE_ for allies).
This patch fixes it.
--
mateusz
Index: advdiplomacy.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdiplomacy.c,v
retrieving revision 1.33
diff -u -r1.33 advdiplomacy.c
--- advdiplomacy.c      2 Sep 2004 20:10:06 -0000       1.33
+++ advdiplomacy.c      3 Sep 2004 15:27:55 -0000
@@ -788,9 +788,10 @@
     }
 
     /* Strongly prefer players we are at war with already. */
-    if (pplayers_non_attack(pplayer, aplayer)) {
+    if (!pplayers_at_war(pplayer, aplayer)) {
       war_desire[aplayer->player_no] /= 2;
     }
+    
     PLAYER_LOG(LOG_DEBUG, pplayer, ai, "Against %s we have war desire "
             "%d ", aplayer->name, war_desire[aplayer->player_no]);
 

[Prev in Thread] Current Thread [Next in Thread]
  • [freeciv-ai] (PR#9920) Wrong use of pplayers_non_attack in ai_diplomacy_calculate, Mateusz Stefek <=