diff --git a/front/src/Phaser/Map/LayersFlattener.ts b/front/src/Phaser/Map/LayersFlattener.ts index d28402b5..fabce94b 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 {