From 9ac019caea64a425a0ddb0835d3b17ccede76f87 Mon Sep 17 00:00:00 2001 From: OptimizedForDensity <105244635+OptimizedForDensity@users.noreply.github.com> Date: Mon, 13 Jun 2022 19:06:29 -0400 Subject: [PATCH] Prevent AI from sending a second peace treaty (#7150) --- core/src/com/unciv/logic/automation/NextTurnAutomation.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt index ef7bded8f2..460f47239a 100644 --- a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt +++ b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt @@ -790,6 +790,8 @@ object NextTurnAutomation { .filter { !civInfo.getDiplomacyManager(it).hasFlag(DiplomacyFlags.DeclinedPeace) } // Don't allow AIs to offer peace to city states allied with their enemies .filterNot { it.isCityState() && it.getAllyCiv() != null && civInfo.isAtWarWith(civInfo.gameInfo.getCivilization(it.getAllyCiv()!!)) } + // ignore civs that we have already offered peace this turn as a counteroffer to another civ's peace offer + .filter { it.tradeRequests.none { tradeRequest -> tradeRequest.requestingCiv == civInfo.civName && tradeRequest.trade.isPeaceTreaty() } } for (enemy in enemiesCiv) { val motivationToAttack = motivationToAttack(civInfo, enemy)