mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Fixed niche bug that let you try and capture civilians in territory you can't enter
This commit is contained in:
parent
e43e23b9a8
commit
b9d2078442
@ -39,6 +39,12 @@ object BattleHelper {
|
||||
): ArrayList<AttackableTile> {
|
||||
val tilesWithEnemies = (tilesToCheck ?: unit.civInfo.viewableTiles)
|
||||
.filter { containsAttackableEnemy(it, MapUnitCombatant(unit)) }
|
||||
.filterNot { val mapCombatant = Battle.getMapCombatantOfTile(it)
|
||||
// IF all of these are true, THEN the action we'll be taking is in fact CAPTURING the civilian.
|
||||
unit.baseUnit.isMelee() && mapCombatant is MapUnitCombatant && mapCombatant.unit.isCivilian()
|
||||
// If we can't pass though that tile, we can't capture the civilian "remotely"
|
||||
&& !unit.movement.canPassThrough(it)
|
||||
}
|
||||
|
||||
val rangeOfAttack = unit.getRange()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user