Fix for bug related to Issue #4737

- When removing a layer from a tilemap, layerIndex can become invalid
- Added loop to fix any existing tilemapLayer.layerIndex vales
This commit is contained in:
Seth Berrier 2019-10-31 16:03:48 -05:00
parent c25331cf30
commit 13b6d6d5ae

View file

@ -1564,6 +1564,13 @@ var Tilemap = new Class({
if (index !== null)
{
SpliceOne(this.layers, index);
for (var i = index; i < this.layers.length; i++)
{
if (this.layers[i].tilemapLayer)
{
this.layers[i].tilemapLayer.layerIndex--;
}
}
if (this.currentLayerIndex === index)
{