From cba5ab0b912346e91432a8f50d51f25281373529 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Mon, 9 Jan 2023 09:08:40 +0200 Subject: [PATCH] Sleeping units wake if there's an enemy in 3-tile radius --- core/src/com/unciv/logic/map/MapUnit.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index f9a73b264b..c1ba317f8f 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -878,8 +878,7 @@ class MapUnit : IsPartOfGameInfoSerialization { // For every double-stacked tile, check if our cohabitant can boost our speed for (unit in getTile().getUnits()) { - if (unit == this) - continue + if (unit == this) continue if (unit.getMatchingUniques(UniqueType.TransferMovement) .any { matchesFilter(it.params[0]) } ) @@ -890,8 +889,8 @@ class MapUnit : IsPartOfGameInfoSerialization { // Wake sleeping units if there's an enemy in vision range: // Military units always but civilians only if not protected. if (isSleeping() && (isMilitary() || (currentTile.militaryUnit == null && !currentTile.isCityCenter())) && - this.viewableTiles.any { - it.militaryUnit != null && it.militaryUnit!!.civInfo.isAtWarWith(civInfo) + this.currentTile.getTilesInDistance(3).any { + it.militaryUnit != null && it in civInfo.viewableTiles && it.militaryUnit!!.civInfo.isAtWarWith(civInfo) } ) action = null