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() {
civInfo=civilizationInfo
otherCivName=OtherCivName
civInfo = civilizationInfo
otherCivName = OtherCivName
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
fun updateHasOpenBorders() {
val newHasOpenBorders = trades.flatMap { it.theirOffers }
.any { it.name == Constants.openBorders && it.duration > 0 }
val newHasOpenBorders = civInfo.getAllyCiv() == otherCivName || otherCiv().getAllyCiv() == civInfo.civName
|| trades.flatMap { it.theirOffers }.any { it.name == Constants.openBorders && it.duration > 0 }
val bordersWereClosed = hasOpenBorders && !newHasOpenBorders
hasOpenBorders = newHasOpenBorders