From d9ce5bd4f1ad4ec78df11d234bbe34c4ab961fed Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Wed, 14 Dec 2022 16:41:54 -0500 Subject: [PATCH] Fixes #109: Ensure that 'remove player from interactable' happens BEFORE removing from the town --- townService/src/town/Town.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/townService/src/town/Town.ts b/townService/src/town/Town.ts index eb3b25d06..14b2b8d06 100644 --- a/townService/src/town/Town.ts +++ b/townService/src/town/Town.ts @@ -165,11 +165,11 @@ export default class Town { * @param session PlayerSession to destroy */ private _removePlayer(player: Player): void { - this._players = this._players.filter(p => p.id !== player.id); - this._broadcastEmitter.emit('playerDisconnect', player.toPlayerModel()); if (player.location.interactableID) { this._removePlayerFromInteractable(player); } + this._players = this._players.filter(p => p.id !== player.id); + this._broadcastEmitter.emit('playerDisconnect', player.toPlayerModel()); } /**