From 2fd8eb3c91db584fc05766e9c139f902ed3d479c Mon Sep 17 00:00:00 2001 From: _Bastler <_Bastler@bstly.de> Date: Thu, 9 Sep 2021 08:56:26 +0200 Subject: [PATCH] fix flatten layers --- front/src/Phaser/Map/LayersFlattener.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/Phaser/Map/LayersFlattener.ts b/front/src/Phaser/Map/LayersFlattener.ts index d28402b5..2d6fb278 100644 --- a/front/src/Phaser/Map/LayersFlattener.ts +++ b/front/src/Phaser/Map/LayersFlattener.ts @@ -10,7 +10,7 @@ export function flattenGroupLayersMap(map: ITiledMap) { } function flattenGroupLayers(layers: ITiledMapLayer[], prefix: string, flatLayers: ITiledMapLayer[]) { - for (const layer of layers) { + for (const layer of layers.map(layer => ({...layer}))) { if (layer.type === "group") { flattenGroupLayers(layer.layers, prefix + layer.name + "/", flatLayers); } else {