mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-08 23:08:35 +07:00
Military unit capturing respects "Uncapturable" unique
This commit is contained in:
@ -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
|
// 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 !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
|
if (!defender.isDefeated() || defender.unit.isCivilian()) return false
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user