From 36eecd693dde89979d4ab2ddb785ba82b4d87b4e Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Sat, 26 Nov 2022 03:30:53 -0700 Subject: [PATCH] Brick stack sizes are now unlimited Make brick stacks unlimited as they were in live. If you have more than uint32_max bricks, the extra bricks are trashed. --- dGame/dComponents/InventoryComponent.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dGame/dComponents/InventoryComponent.cpp b/dGame/dComponents/InventoryComponent.cpp index 930ace8d..12b6792e 100644 --- a/dGame/dComponents/InventoryComponent.cpp +++ b/dGame/dComponents/InventoryComponent.cpp @@ -211,7 +211,7 @@ void InventoryComponent::AddItem( // info.itemType of 1 is item type brick if (inventoryType == eInventoryType::BRICKS || (stack == 0 && info.itemType == 1)) { - stack = 999; + stack = UINT32_MAX; } else if (stack == 0) { stack = 1; } @@ -232,7 +232,8 @@ void InventoryComponent::AddItem( } } - while (left > 0) { + // If we have some leftover and we aren't bricks, make a new stack + while (left > 0 && !(inventoryType == eInventoryType::BRICKS || (stack == 0 && info.itemType == 1))) { const auto size = std::min(left, stack); left -= size;