introduce itemsDb variable inside repairItemByKit()
This commit is contained in:
parent
ce65ec1260
commit
08c81aff26
@ -196,7 +196,8 @@ export class RepairService
|
|||||||
throw new Error(`Item ${itemToRepairId} not found, unable to repair`);
|
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);
|
const repairItemIsArmor = (!!itemToRepairDetails._props.ArmorMaterial);
|
||||||
|
|
||||||
this.repairHelper.updateItemDurability(
|
this.repairHelper.updateItemDurability(
|
||||||
@ -211,7 +212,7 @@ export class RepairService
|
|||||||
for (const repairKit of repairKits)
|
for (const repairKit of repairKits)
|
||||||
{
|
{
|
||||||
const repairKitInInventory = pmcData.Inventory.items.find(x => x._id === repairKit._id);
|
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;
|
const repairKitReductionAmount = repairKit.count;
|
||||||
|
|
||||||
this.addMaxResourceToKitIfMissing(repairKitDetails, repairKitInInventory);
|
this.addMaxResourceToKitIfMissing(repairKitDetails, repairKitInInventory);
|
||||||
|
Loading…
Reference in New Issue
Block a user