mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 06:16:37 -04:00
AI won't declare war if it doesn't know the location of any enemy city
This commit is contained in:
parent
ab8b4405f2
commit
e8e9c97c92
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user