mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 20:31:51 -04:00
Fixed modification exception when destroying transported units
This commit is contained in:
parent
5e5a175f06
commit
f0adc40e81
@ -477,7 +477,7 @@ class MapUnit {
|
||||
civInfo.removeUnit(this)
|
||||
civInfo.updateViewableTiles()
|
||||
// all transported units should be destroyed as well
|
||||
currentTile.getUnits().filter { it.isTransported && isTransportTypeOf(it) }
|
||||
currentTile.getUnits().filter { it.isTransported && isTransportTypeOf(it) }.toList() // because we're changing the list
|
||||
.forEach { unit -> unit.destroy() }
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user