From 66656de5fcb0c0a6b64b1ff7f9c0a5a1671ca377 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Tue, 16 Apr 2024 00:16:57 +0300 Subject: [PATCH] Military unit capturing respects "Uncapturable" unique --- core/src/com/unciv/logic/battle/BattleUnitCapture.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/com/unciv/logic/battle/BattleUnitCapture.kt b/core/src/com/unciv/logic/battle/BattleUnitCapture.kt index 60770b0086..0345bb5587 100644 --- a/core/src/com/unciv/logic/battle/BattleUnitCapture.kt +++ b/core/src/com/unciv/logic/battle/BattleUnitCapture.kt @@ -23,6 +23,9 @@ object BattleUnitCapture { // There are 3 ways of capturing a unit, we separate them for cleaner code but we also need to ensure a unit isn't captured twice if (defender !is MapUnitCombatant || attacker !is MapUnitCombatant) return false + if (defender.hasUnique(UniqueType.Uncapturable, StateForConditionals(unit = defender.unit, + ourCombatant = defender, theirCombatant = attacker, attackedTile = attackedTile))) + return false if (!defender.isDefeated() || defender.unit.isCivilian()) return false