From 4356ee996730730c95aa7a8e5c97dfb777c14281 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Fri, 26 Dec 2025 08:35:43 +0200
Subject: [PATCH 47/47] AI: Fix failing war_countdown() "adip->countdown == -1"
 assert

War declaration because of target's spaceship launch proceeded
when the countdown was already indicating war, but player's were
not in war yet. This is possible situation when the senate
is blocking the war, and we are waiting for it to be dissolved
in the next turn change.

See RM #1834

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 ai/default/daidiplomacy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ai/default/daidiplomacy.c b/ai/default/daidiplomacy.c
index 61aa11d8e8..08ff46ef61 100644
--- a/ai/default/daidiplomacy.c
+++ b/ai/default/daidiplomacy.c
@@ -1654,7 +1654,7 @@ void dai_diplomacy_actions(struct ai_type *ait, struct player *pplayer)
       struct player_spaceship *ship = &aplayer->spaceship;
 
       if (aplayer == pplayer
-          || adip->countdown >= 0  /* Already counting down to war */
+          || adip->countdown != -1  /* Already counting down to war */
           || ship->state == SSHIP_NONE
           || players_on_same_team(pplayer, aplayer)
           || pplayers_at_war(pplayer, aplayer)) {
-- 
2.51.0

