mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 22:37:02 -04: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() {
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user