From ce175278cd2b65b86830eba7dac0d9dc7953e925 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 3 Sep 2023 08:37:00 +0300 Subject: [PATCH 14/16] 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ai/default/daidiplomacy.c b/ai/default/daidiplomacy.c index d4803db406..8b47524613 100644 --- a/ai/default/daidiplomacy.c +++ b/ai/default/daidiplomacy.c @@ -1383,6 +1383,7 @@ static void dai_go_to_war(struct ai_type *ait, struct player *pplayer, } else { /* There would be Senate even during revolution. Better not to revolt for nothing */ pplayer->government = real_gov; + adip->countdown = -1; /* War declaration aborted */ DIPLO_LOG(ait, LOG_DEBUG, pplayer, target, "Not revolting, as there would be Senate regardless."); @@ -1396,6 +1397,8 @@ static void dai_go_to_war(struct ai_type *ait, struct player *pplayer, if (pplayer_can_cancel_treaty(pplayer, target) != DIPL_OK) { 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