From 7941675102cabc7d5d7bc9e1511f4d765e3c18ba Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 7 Nov 2023 21:13:41 +0000 Subject: [PATCH 1/2] `getItemPrice()` if static price is 0 and dynamic price is missing, return 0 instead of undefined --- project/src/helpers/ItemHelper.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project/src/helpers/ItemHelper.ts b/project/src/helpers/ItemHelper.ts index 6109a9f0..c5bcd324 100644 --- a/project/src/helpers/ItemHelper.ts +++ b/project/src/helpers/ItemHelper.ts @@ -117,6 +117,8 @@ class ItemHelper { return dynamicPrice; } + + return 0; } /** From dfd1bcc58918b059eb82bed5a56e79b8cfaec3b2 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 7 Nov 2023 21:21:34 +0000 Subject: [PATCH 2/2] getTemplatePrice(), when an item cannot be found in the handbook, add it with the price of 0 instead of 1 --- project/src/helpers/HandbookHelper.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/project/src/helpers/HandbookHelper.ts b/project/src/helpers/HandbookHelper.ts index 74c3e876..b674daeb 100644 --- a/project/src/helpers/HandbookHelper.ts +++ b/project/src/helpers/HandbookHelper.ts @@ -92,9 +92,10 @@ export class HandbookHelper const handbookItem = this.databaseServer.getTables().templates.handbook.Items.find(x => x.Id === tpl); if (!handbookItem) { - this.handbookPriceCache.items.byId.set(tpl, 1); + const newValue = 0; + this.handbookPriceCache.items.byId.set(tpl, newValue); - return 1; + return newValue; } return handbookItem.Price;