mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-21 01:37:39 +07:00
City-state allies are always considered to have open borders
This commit is contained in:
parent
1ada5aff43
commit
cfc337f6ef
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user