From f585f96ecf52936834e8556fb9ea1dc0654c15b7 Mon Sep 17 00:00:00 2001 From: ForestOfLight Date: Fri, 6 Jun 2025 03:19:18 -0700 Subject: [PATCH] Fixed a bug where an instance would be deleted if a server restarted while no players were online --- Construct[BP]/scripts/classes/Instance/StructureInstance.js | 2 ++ Construct[BP]/scripts/classes/Render/VerificationRenderer.js | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Construct[BP]/scripts/classes/Instance/StructureInstance.js b/Construct[BP]/scripts/classes/Instance/StructureInstance.js index e3fa942..73f005c 100644 --- a/Construct[BP]/scripts/classes/Instance/StructureInstance.js +++ b/Construct[BP]/scripts/classes/Instance/StructureInstance.js @@ -250,6 +250,7 @@ export class StructureInstance { world.beforeEvents.playerLeave.subscribe(event => { system.run(() => { if (world.getAllPlayers().length === 0) { + console.info(`[Construct] No players are online. Disabling instance: '${this.options.instanceName}'`); this.disable(); this.shouldEnableOnJoin = true; } @@ -257,6 +258,7 @@ export class StructureInstance { }); world.afterEvents.playerJoin.subscribe(event => { if (this.shouldEnableOnJoin) { + console.info(`[Construct] A player rejoined. Re-enabling instance: '${this.options.instanceName}'`); this.enable(); this.shouldEnableOnJoin = false; } diff --git a/Construct[BP]/scripts/classes/Render/VerificationRenderer.js b/Construct[BP]/scripts/classes/Render/VerificationRenderer.js index 37b10a1..23efc95 100644 --- a/Construct[BP]/scripts/classes/Render/VerificationRenderer.js +++ b/Construct[BP]/scripts/classes/Render/VerificationRenderer.js @@ -13,7 +13,6 @@ export class VerificationRenderer { constructor(instance) { this.instance = instance; - const bounds = this.instance.getActiveBounds(); this.lastRenderedChunk = 0; }