Tilemap.getLayerIndex will now return null if a given TilemapLayer instance doesn't belong to the Tilemap or has been destroyed.

This commit is contained in:
Richard Davey 2023-04-10 17:43:02 +01:00
parent 71bc9ad4f6
commit 950f0a8363

View file

@ -1282,7 +1282,7 @@ var Tilemap = new Class({
{
return layer;
}
else if (layer instanceof TilemapLayer)
else if (layer instanceof TilemapLayer && layer.tilemap === this)
{
return layer.layerIndex;
}