Fixing connection closing

This commit is contained in:
David Négrier 2020-10-01 17:16:49 +02:00
parent e1193ad95a
commit 1061c80f1f
2 changed files with 6 additions and 1 deletions

View file

@ -951,7 +951,7 @@ export class GameScene extends Phaser.Scene implements CenterListener {
});
const nextSceneKey = this.checkToExit();
if(nextSceneKey){
if (nextSceneKey) {
// We are completely destroying the current scene to avoid using a half-backed instance when coming back to the same map.
this.connection.closeConnection();
this.simplePeer.unregister();