Skip to content

Commit

Permalink
Merge pull request #413 from runejs/fix-instance-check
Browse files Browse the repository at this point in the history
fix: check global instance correctly
  • Loading branch information
Jameskmonger authored Jul 17, 2023
2 parents 98e2205 + 0095a4f commit d9d5d50
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 d9d5d50

Please sign in to comment.