mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-22 21:43:35 +00:00
Fix bricks not creating new stacks (#860)
Unintentionally, bricks were not creating new stacks if you tried to get another stack. This prevents some missions from being completed. This issue is now fixed
This commit is contained in:
parent
09dfb6df3a
commit
63460ea00d
@ -209,8 +209,10 @@ void InventoryComponent::AddItem(
|
||||
|
||||
auto stack = static_cast<uint32_t>(info.stackSize);
|
||||
|
||||
bool isBrick = inventoryType == eInventoryType::BRICKS || (stack == 0 && info.itemType == 1);
|
||||
|
||||
// info.itemType of 1 is item type brick
|
||||
if (inventoryType == eInventoryType::BRICKS || (stack == 0 && info.itemType == 1)) {
|
||||
if (isBrick) {
|
||||
stack = UINT32_MAX;
|
||||
} else if (stack == 0) {
|
||||
stack = 1;
|
||||
@ -233,7 +235,7 @@ void InventoryComponent::AddItem(
|
||||
}
|
||||
|
||||
// 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))) {
|
||||
while (left > 0 && (!isBrick || (isBrick && !existing))) {
|
||||
const auto size = std::min(left, stack);
|
||||
|
||||
left -= size;
|
||||
|
Loading…
Reference in New Issue
Block a user