fix wrong layer names after re-enter room
This commit is contained in:
parent
1db11a45e3
commit
36df585a5e
@ -10,7 +10,7 @@ export function flattenGroupLayersMap(map: ITiledMap) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function flattenGroupLayers(layers: ITiledMapLayer[], prefix: string, flatLayers: ITiledMapLayer[]) {
|
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") {
|
if (layer.type === "group") {
|
||||||
flattenGroupLayers(layer.layers, prefix + layer.name + "/", flatLayers);
|
flattenGroupLayers(layer.layers, prefix + layer.name + "/", flatLayers);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user