From 18df863a5d4925980c302dc20ca2d9633b5edde7 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 4 Sep 2023 05:32:28 +0300 Subject: [PATCH 2/2] AI: Set countdown correctly if senate blocks war completely Reported by alain_bkr See osdn #47786 Signed-off-by: Marko Lindqvist --- ai/default/daidiplomacy.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ai/default/daidiplomacy.c b/ai/default/daidiplomacy.c index 81e8c51533..d75b051e15 100644 --- a/ai/default/daidiplomacy.c +++ b/ai/default/daidiplomacy.c @@ -1339,8 +1339,10 @@ static void dai_go_to_war(struct ai_type *ait, struct player *pplayer, /* This will take us straight to war. */ while (player_diplstate_get(pplayer, target)->type != DS_WAR) { if (pplayer_can_cancel_treaty(pplayer, target) != DIPL_OK) { - DIPLO_LOG(ait, LOG_ERROR, pplayer, target, "Wanted to cancel treaty but " - "was unable to."); + DIPLO_LOG(ait, LOG_ERROR, pplayer, target, + "Wanted to cancel treaty but was unable to."); + adip->countdown = -1; /* War declaration aborted */ + return; } handle_diplomacy_cancel_pact(pplayer, player_number(target), clause_type_invalid()); -- 2.40.1