mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-24 10:01:39 +07:00
Military unit capturing respects "Uncapturable" unique
This commit is contained in:
parent
f69539ab92
commit
66656de5fc
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user