From 4cc10aa38f717c13b0fd8412f846d251f0ea6bc1 Mon Sep 17 00:00:00 2001 From: Jack Rainy Date: Sat, 11 Apr 2020 21:37:40 +0300 Subject: [PATCH] Do not wake up a general or a worker if they are protected (#2383) --- core/src/com/unciv/logic/map/MapUnit.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index 5401a56999..577d9d59c3 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -450,8 +450,9 @@ class MapUnit { attacksThisTurn = 0 due = true - // Wake sleeping units if there's an enemy nearby - if (isSleeping() && currentTile.getTilesInDistance(2).any { + // Wake sleeping units if there's an enemy nearby and civilian is not protected + if (isSleeping() && (!type.isCivilian() || currentTile.militaryUnit == null) && + currentTile.getTilesInDistance(2).any { it.militaryUnit != null && it.militaryUnit!!.civInfo.isAtWarWith(civInfo) }) action = null