From 6d30d86ea47740930c252ea777e8056934be4a63 Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 28 Oct 2023 17:57:14 +0100 Subject: [PATCH] Correctly handle when crafts are completed, null craft data instead of removing entire production key/value pair --- project/src/controllers/HideoutController.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/project/src/controllers/HideoutController.ts b/project/src/controllers/HideoutController.ts index 5894bd4f..fb2d7e0d 100644 --- a/project/src/controllers/HideoutController.ts +++ b/project/src/controllers/HideoutController.ts @@ -733,8 +733,8 @@ export class HideoutController area.lastRecipe = request.recipeId; counterHoursCrafting.value = hoursCrafting; - // Delete production now it's complete - delete pmcData.Hideout.Production[prodId]; + // Null production data now it's complete - will be cleaned up later by update() process + pmcData.Hideout.Production[prodId] = null; }; // Remove the old production from output object before its sent to client @@ -813,7 +813,9 @@ export class HideoutController const callback = () => { - delete pmcData.Hideout.Production[prodId]; + + // Null production data now it's complete - will be cleaned up later by update() process + pmcData.Hideout.Production[prodId] = null; }; return this.inventoryHelper.addItem(pmcData, newReq, output, sessionID, callback, true);