mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-23 05:53:34 +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);
|
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
|
// info.itemType of 1 is item type brick
|
||||||
if (inventoryType == eInventoryType::BRICKS || (stack == 0 && info.itemType == 1)) {
|
if (isBrick) {
|
||||||
stack = UINT32_MAX;
|
stack = UINT32_MAX;
|
||||||
} else if (stack == 0) {
|
} else if (stack == 0) {
|
||||||
stack = 1;
|
stack = 1;
|
||||||
@ -233,7 +235,7 @@ void InventoryComponent::AddItem(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we have some leftover and we aren't bricks, make a new stack
|
// 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);
|
const auto size = std::min(left, stack);
|
||||||
|
|
||||||
left -= size;
|
left -= size;
|
||||||
|
Loading…
Reference in New Issue
Block a user