From e8e9c97c92795cad11b859e028e8b05660b84654 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 11 Nov 2020 21:22:15 +0200 Subject: [PATCH] AI won't declare war if it doesn't know the location of any enemy city --- core/src/com/unciv/logic/automation/NextTurnAutomation.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt index d1c50e50d9..8135ee8dea 100644 --- a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt +++ b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt @@ -360,7 +360,11 @@ object NextTurnAutomation { //evaluate war val enemyCivs = civInfo.getKnownCivs() - .filterNot { it == civInfo || it.cities.isEmpty() || !civInfo.getDiplomacyManager(it).canDeclareWar() } + .filterNot { it == civInfo || it.cities.isEmpty() || !civInfo.getDiplomacyManager(it).canDeclareWar() + || (it.cities.none { civInfo.exploredTiles.contains(it.location) }) } + // If the AI declares war on a civ without knowing the location of any cities, it'll just keep amassing an army and not sending it anywhere, + // and end up at a massive disadvantage + if (enemyCivs.isEmpty()) return val civWithBestMotivationToAttack = enemyCivs