mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 06:16:37 -04:00
Fixed concurrent modification problem in Nuke attack
This commit is contained in:
parent
6c221cd56b
commit
82fd24f12c
@ -473,7 +473,8 @@ object Battle {
|
||||
if (attacker.isDefeated()) return
|
||||
|
||||
// Destroy units on the target tile
|
||||
for (defender in targetTile.getUnits().filter { it != attacker.unit }) {
|
||||
// Needs the toList() because if we're destroying the units, they're no longer part of the sequence
|
||||
for (defender in targetTile.getUnits().filter { it != attacker.unit }.toList()) {
|
||||
defender.destroy()
|
||||
postBattleNotifications(attacker, MapUnitCombatant(defender), defender.getTile())
|
||||
destroyIfDefeated(defender.civInfo, attacker.getCivInfo())
|
||||
|
Loading…
x
Reference in New Issue
Block a user