Fixed crashes caused by 'healing on friendly tile' checks to unmet civs for barbarians
This commit is contained in:
parent
a73fe3d9de
commit
24c3bdc564
1 changed files with 6 additions and 4 deletions
|
@ -398,10 +398,12 @@ class MapUnit {
|
|||
/** Returns the health points [MapUnit] will receive if healing on [tileInfo] */
|
||||
fun rankTileForHealing(tileInfo: TileInfo): Int {
|
||||
val tileOwner = tileInfo.getOwner()
|
||||
val isAlliedTerritory = if (tileOwner != null)
|
||||
tileOwner == civInfo || tileOwner.getDiplomacyManager(civInfo).isConsideredAllyTerritory()
|
||||
else
|
||||
false
|
||||
val isAlliedTerritory = when {
|
||||
tileOwner == null -> false
|
||||
tileOwner == civInfo -> true
|
||||
!civInfo.knows(tileOwner) -> false
|
||||
else -> tileOwner.getDiplomacyManager(civInfo).isConsideredAllyTerritory()
|
||||
}
|
||||
|
||||
var healing = when {
|
||||
tileInfo.isCityCenter() -> 20
|
||||
|
|
Loading…
Reference in a new issue