Skip to content

Commit

Permalink
fix: check global instance correctly
Browse files Browse the repository at this point in the history
global instance now has an ID so we need to check against it rather than checking for `null`

fixes #399
  • Loading branch information
Jameskmonger committed Jul 17, 2023
1 parent 98e2205 commit 0095a4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/engine/world/instances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ export class WorldInstance {
public removePlayer(player: Player): void {
this.players.delete(player.username);

if(this.instanceId !== null && this.players.size === 0) {
if(this.instanceId !== activeWorld.globalInstance.instanceId && this.players.size === 0) {
this.chunkModifications.clear();
const instancedNpcs = activeWorld.findNpcsByInstance(this.instanceId);
instancedNpcs?.forEach(npc => activeWorld.deregisterNpc(npc));
Expand Down

0 comments on commit 0095a4f

Please sign in to comment.