mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-20 01:07:40 +07:00
safer logic (#8139)
This commit is contained in:
parent
e1afa1e10e
commit
1fb43a805f
@ -354,7 +354,7 @@ object UnitAutomation {
|
||||
.filter { it.value.totalDistance < unit.currentMovement }.keys
|
||||
.filter { unit.movement.canMoveTo(it) && UnitActions.canPillage(unit, it)
|
||||
&& (it.canPillageTileImprovement()
|
||||
|| (it.canPillageRoad() && it.roadOwner != "" && unit.civInfo.isAtWarWith(it.getRoadOwner()!!)))}
|
||||
|| (it.canPillageRoad() && it.getRoadOwner() != null && unit.civInfo.isAtWarWith(it.getRoadOwner()!!)))}
|
||||
|
||||
if (tilesThatCanWalkToAndThenPillage.isEmpty()) return false
|
||||
val tileToPillage = tilesThatCanWalkToAndThenPillage.maxByOrNull { it.getDefensiveBonus() }!!
|
||||
|
Loading…
Reference in New Issue
Block a user