Skip to content

Commit

Permalink
Fixes #109: Ensure that 'remove player from interactable' happens BEF…
Browse files Browse the repository at this point in the history
…ORE removing from the town
  • Loading branch information
jon-bell committed Dec 14, 2022
1 parent 6904d83 commit d9ce5bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions townService/src/town/Town.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

/**
Expand Down

0 comments on commit d9ce5bd

Please sign in to comment.