From 1fb43a805fd1cebcb7e11709fd2816d5814acae2 Mon Sep 17 00:00:00 2001 From: itanasi <44038014+itanasi@users.noreply.github.com> Date: Wed, 14 Dec 2022 22:53:18 -0800 Subject: [PATCH] safer logic (#8139) --- core/src/com/unciv/logic/automation/unit/UnitAutomation.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt b/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt index f16cda1443..57cd103df1 100644 --- a/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/unit/UnitAutomation.kt @@ -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() }!!