From 995d50dba4bcfd6353962c4ca31fd5a74ccc9c89 Mon Sep 17 00:00:00 2001 From: Dev Date: Sun, 28 Apr 2024 22:50:39 +0100 Subject: [PATCH] made use of function `addUpdObjectToItem()` --- project/src/controllers/HealthController.ts | 6 ++---- project/src/helpers/ItemHelper.ts | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/project/src/controllers/HealthController.ts b/project/src/controllers/HealthController.ts index 6f045ce8..f69ade0e 100644 --- a/project/src/controllers/HealthController.ts +++ b/project/src/controllers/HealthController.ts @@ -127,10 +127,8 @@ export class HealthController const consumedItemMaxResource = this.itemHelper.getItem(itemToConsume._tpl)[1]._props.MaxResource; if (consumedItemMaxResource > 1) { - if (!itemToConsume.upd) - { - itemToConsume.upd = {}; - } + // Ensure item has a upd object + this.itemHelper.addUpdObjectToItem(itemToConsume); if (itemToConsume.upd.FoodDrink === undefined) { diff --git a/project/src/helpers/ItemHelper.ts b/project/src/helpers/ItemHelper.ts index 0a9ed753..05aa54de 100644 --- a/project/src/helpers/ItemHelper.ts +++ b/project/src/helpers/ItemHelper.ts @@ -1667,7 +1667,7 @@ export class ItemHelper if (warningMessageWhenMissing) { - this.logger.warning(warningMessageWhenMissing); + this.logger.debug(warningMessageWhenMissing); } return true;