From 08c81aff26f2447f71d59862ae4458ca01f03b30 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 4 Aug 2023 15:59:34 +0100 Subject: [PATCH] introduce itemsDb variable inside repairItemByKit() --- project/src/services/RepairService.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/project/src/services/RepairService.ts b/project/src/services/RepairService.ts index 91277b3d..302f53fe 100644 --- a/project/src/services/RepairService.ts +++ b/project/src/services/RepairService.ts @@ -196,7 +196,8 @@ export class RepairService throw new Error(`Item ${itemToRepairId} not found, unable to repair`); } - const itemToRepairDetails = this.databaseServer.getTables().templates.items[itemToRepair._tpl]; + const itemsDb = this.databaseServer.getTables().templates.items; + const itemToRepairDetails = itemsDb[itemToRepair._tpl]; const repairItemIsArmor = (!!itemToRepairDetails._props.ArmorMaterial); this.repairHelper.updateItemDurability( @@ -211,7 +212,7 @@ export class RepairService for (const repairKit of repairKits) { const repairKitInInventory = pmcData.Inventory.items.find(x => x._id === repairKit._id); - const repairKitDetails = this.databaseServer.getTables().templates.items[repairKitInInventory._tpl]; + const repairKitDetails = itemsDb[repairKitInInventory._tpl]; const repairKitReductionAmount = repairKit.count; this.addMaxResourceToKitIfMissing(repairKitDetails, repairKitInInventory);