fix flatten layers

This commit is contained in:
_Bastler 2021-09-09 08:56:26 +02:00
parent 52489f9c72
commit 2fd8eb3c91

View File

@ -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 {