Update GameScene.ts

stop all the map specific stuff (Jitsi, coWebsite, Audio) when leaving the scene
Fixes #633
This commit is contained in:
TabascoEye 2021-01-23 01:16:13 +01:00 committed by GitHub
parent 3d84a9c8cd
commit 39b433eef5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -698,6 +698,10 @@ export class GameScene extends ResizableScene implements CenterListener {
}
public cleanupClosingScene(): void {
// stop playing audio, close any open website, stop any open Jitsi
coWebsiteManager.closeCoWebsite();
this.stopJitsi();
this.playAudio(undefined);
// We are completely destroying the current scene to avoid using a half-backed instance when coming back to the same map.
if(this.connection) {
this.connection.closeConnection();