From 9b3d18ded5a665b84a8b983848d39483e803781a Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 30 Sep 2024 17:29:19 +0100 Subject: [PATCH] Improved wrong container size error --- project/src/helpers/InventoryHelper.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/project/src/helpers/InventoryHelper.ts b/project/src/helpers/InventoryHelper.ts index 041d9594..ac72d98e 100644 --- a/project/src/helpers/InventoryHelper.ts +++ b/project/src/helpers/InventoryHelper.ts @@ -771,8 +771,12 @@ export class InventoryHelper { for (let y = 0; y < fH; y++) { try { + const containerRow = container2D[itemLocation.y + y]; + if (!containerRow) { + this.logger.error(`Unable to find container: ${containerId} row line: ${itemLocation.y + y}`); + } // Fill the corresponding cells in the container map to show the slot is taken - container2D[itemLocation.y + y].fill(1, itemLocation.x, fillTo); + containerRow.fill(1, itemLocation.x, fillTo); } catch (e) { this.logger.error( this.localisationService.getText("inventory-unable_to_fill_container", {