From f0adc40e814bcf42b383b373655e740dcd1bb8ed Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 26 Apr 2020 20:50:09 +0300 Subject: [PATCH] Fixed modification exception when destroying transported units --- core/src/com/unciv/logic/map/MapUnit.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index f73b90791e..9869f28240 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -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() } }