Merge pull request #1235 from thecodingmachine/fix_map_change

Fixing a lock when the player is moving from one room to the other
This commit is contained in:
David Négrier 2021-06-24 17:08:06 +02:00 committed by GitHub
commit 63d4c99d15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -161,6 +161,7 @@ export class GameScene extends DirtyScene {
private createPromiseResolve!: (value?: void | PromiseLike<void>) => void;
private iframeSubscriptionList!: Array<Subscription>;
private peerStoreUnsubscribe!: () => void;
private biggestAvailableAreaStoreUnsubscribe!: () => void;
MapUrlFile: string;
RoomId: string;
instance: string;
@ -501,7 +502,7 @@ export class GameScene extends DirtyScene {
this.reposition();
// From now, this game scene will be notified of reposition events
biggestAvailableAreaStore.subscribe((box) => this.updateCameraOffset(box));
this.biggestAvailableAreaStoreUnsubscribe = biggestAvailableAreaStore.subscribe((box) => this.updateCameraOffset(box));
this.triggerOnMapLayerPropertyChange();
this.listenToIframeEvents();
@ -1025,6 +1026,7 @@ ${escapedMessage}
this.pinchManager?.destroy();
this.emoteManager.destroy();
this.peerStoreUnsubscribe();
this.biggestAvailableAreaStoreUnsubscribe();
mediaManager.hideGameOverlay();