Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2005:
[Freeciv-Dev] Re: (PR#14617) civserver: advdiplomacy.c:1126: war_countdo
Home

[Freeciv-Dev] Re: (PR#14617) civserver: advdiplomacy.c:1126: war_countdo

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: guillaume.melquiond@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#14617) civserver: advdiplomacy.c:1126: war_countdown: assertion "adip->countdown == -1" failed.
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Wed, 16 Nov 2005 14:02:33 -0800
Reply-to: bugs@xxxxxxxxxxx

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

On Tue, 15 Nov 2005, Guillaume Melquiond wrote:
> Near the end of the game, I have launched a spaceship. Eight turns
> sooner, my allies have threatened to kill me for that. (Note that the
> diplomatic messages are quite strange: "We will be launching an all-out
> war against you in 8 turns [...] Your aid in this matter will be
> expected. Long live our glorious alliance!"). And the server fails an
> assertion, since the AI launches the same countdown again instead of
> declaring war as previously announced.

Haha. Good ones. The two bugs described above fixed in the attached patch.

  - Per

Index: ai/advdiplomacy.c
===================================================================
--- ai/advdiplomacy.c   (revision 11234)
+++ ai/advdiplomacy.c   (working copy)
@@ -1129,7 +1129,9 @@
   adip->war_reason = reason;
 
   players_iterate(ally) {
-    if (!pplayers_allied(pplayer, ally) || !ally->is_alive) {
+    if (!pplayers_allied(pplayer, ally) 
+        || !ally->is_alive
+        || ally == target) {
       continue;
     }
 
@@ -1218,11 +1220,12 @@
                          &ai->diplomacy.player_intel[aplayer->player_no];
       struct player_spaceship *ship = &aplayer->spaceship;
 
-      if (!aplayer->is_alive || aplayer == pplayer
-          || players_on_same_team(pplayer, aplayer)
+      if (!aplayer->is_alive 
+          || aplayer == pplayer
           || adip->countdown >= 0
           || ship->state == SSHIP_NONE
-          || NEVER_MET(pplayer, aplayer)) {
+          || players_on_same_team(pplayer, aplayer)
+          || pplayers_at_war(pplayer, aplayer)) {
         continue;
       }
       /* A spaceship victory is always one single player's or team's victory */

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#14617) civserver: advdiplomacy.c:1126: war_countdown: assertion "adip->countdown == -1" failed., Per I. Mathisen <=