mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 15:14:47 +00:00
DynamicTilemapLayer.destroy
will now no longer run its destroy sequence again if it has already been run once. Fix #4634
This commit is contained in:
parent
da49fcc499
commit
e012115df4
2 changed files with 13 additions and 1 deletions
|
@ -458,6 +458,12 @@ var DynamicTilemapLayer = new Class({
|
|||
{
|
||||
if (removeFromTilemap === undefined) { removeFromTilemap = true; }
|
||||
|
||||
if (!this.tilemap)
|
||||
{
|
||||
// Abort, we've already been destroyed
|
||||
return;
|
||||
}
|
||||
|
||||
// Uninstall this layer only if it is still installed on the LayerData object
|
||||
if (this.layer.tilemapLayer === this)
|
||||
{
|
||||
|
|
|
@ -1446,7 +1446,13 @@ var StaticTilemapLayer = new Class({
|
|||
{
|
||||
if (removeFromTilemap === undefined) { removeFromTilemap = true; }
|
||||
|
||||
// Uninstall this layer only if it is still installed on the LayerData object
|
||||
if (!this.tilemap)
|
||||
{
|
||||
// Abort, we've already been destroyed
|
||||
return;
|
||||
}
|
||||
|
||||
// Uninstall this layer only if it is still installed on the LayerData object
|
||||
if (this.layer.tilemapLayer === this)
|
||||
{
|
||||
this.layer.tilemapLayer = undefined;
|
||||
|
|
Loading…
Reference in a new issue