From bc9d66cfbd56b00dde9acf3188d0a62484d36489 Mon Sep 17 00:00:00 2001 From: Etienne Samson Date: Mon, 3 Nov 2025 16:27:30 +0100 Subject: [PATCH] Fix _create-energy inserting a object with a numeric id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This causes issues later in the client when viewing history, as that id can never match with the for…in stringified key when unrolling the packed history chunk, leading to stray objects saying alive until the next chunk is loaded. --- src/processor/intents/_create-energy.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/processor/intents/_create-energy.js b/src/processor/intents/_create-energy.js index a545b63c..5bf258ce 100644 --- a/src/processor/intents/_create-energy.js +++ b/src/processor/intents/_create-energy.js @@ -40,13 +40,14 @@ module.exports = function(x, y, room, amount, resourceType, scope) { } else { const obj = { + _id: undefined, type: 'energy', x, y, room: room, [resourceType]: amount, resourceType }; - obj._id = bulk.insert(obj); + obj._id = "" + bulk.insert(obj); roomObjects[obj._id] = obj; } }