From 8b6b5530fa93e73d66e65f8e7876c2063548e78a Mon Sep 17 00:00:00 2001 From: ForestOfLight Date: Mon, 9 Jun 2025 23:47:39 -0700 Subject: [PATCH] Fix disabled instance being re-enabled on login --- Construct[BP]/scripts/classes/Instance/StructureInstance.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Construct[BP]/scripts/classes/Instance/StructureInstance.js b/Construct[BP]/scripts/classes/Instance/StructureInstance.js index 73f005c..08c4144 100644 --- a/Construct[BP]/scripts/classes/Instance/StructureInstance.js +++ b/Construct[BP]/scripts/classes/Instance/StructureInstance.js @@ -249,12 +249,12 @@ export class StructureInstance { // This prevents a memory leak when no players are online. world.beforeEvents.playerLeave.subscribe(event => { system.run(() => { - if (world.getAllPlayers().length === 0) { + if (world.getAllPlayers().length === 0 && this.options.isEnabled) { console.info(`[Construct] No players are online. Disabling instance: '${this.options.instanceName}'`); this.disable(); this.shouldEnableOnJoin = true; } - }) + }); }); world.afterEvents.playerJoin.subscribe(event => { if (this.shouldEnableOnJoin) {