City-state allies are always considered to have open borders

This commit is contained in:
Yair Morgenstern 2021-02-05 10:22:01 +02:00
parent 1ada5aff43
commit cfc337f6ef

View File

@ -108,8 +108,8 @@ class DiplomacyManager() {
} }
constructor(civilizationInfo: CivilizationInfo, OtherCivName:String) : this() { constructor(civilizationInfo: CivilizationInfo, OtherCivName:String) : this() {
civInfo=civilizationInfo civInfo = civilizationInfo
otherCivName=OtherCivName otherCivName = OtherCivName
updateHasOpenBorders() updateHasOpenBorders()
} }
@ -308,8 +308,8 @@ class DiplomacyManager() {
// for performance reasons we don't want to call this every time we want to see if a unit can move through a tile // for performance reasons we don't want to call this every time we want to see if a unit can move through a tile
fun updateHasOpenBorders() { fun updateHasOpenBorders() {
val newHasOpenBorders = trades.flatMap { it.theirOffers } val newHasOpenBorders = civInfo.getAllyCiv() == otherCivName || otherCiv().getAllyCiv() == civInfo.civName
.any { it.name == Constants.openBorders && it.duration > 0 } || trades.flatMap { it.theirOffers }.any { it.name == Constants.openBorders && it.duration > 0 }
val bordersWereClosed = hasOpenBorders && !newHasOpenBorders val bordersWereClosed = hasOpenBorders && !newHasOpenBorders
hasOpenBorders = newHasOpenBorders hasOpenBorders = newHasOpenBorders