Merge pull request #737 from MisterErwin/patch-2
Do not change rooms if scene failed to load
This commit is contained in:
commit
43b48ce555
@ -716,6 +716,10 @@ export class GameScene extends ResizableScene implements CenterListener {
|
|||||||
if (!roomId) throw new Error('Could not find the room from its exit key: '+exitKey);
|
if (!roomId) throw new Error('Could not find the room from its exit key: '+exitKey);
|
||||||
urlManager.pushStartLayerNameToUrl(hash);
|
urlManager.pushStartLayerNameToUrl(hash);
|
||||||
if (roomId !== this.scene.key) {
|
if (roomId !== this.scene.key) {
|
||||||
|
if (this.scene.get(roomId) === null) {
|
||||||
|
console.error("next room not loaded", exitKey);
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.cleanupClosingScene();
|
this.cleanupClosingScene();
|
||||||
this.scene.stop();
|
this.scene.stop();
|
||||||
this.scene.remove(this.scene.key);
|
this.scene.remove(this.scene.key);
|
||||||
|
Loading…
Reference in New Issue
Block a user