summaryrefslogtreecommitdiff
path: root/src/resources/inventory
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/inventory')
-rw-r--r--src/resources/inventory/inventory.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/resources/inventory/inventory.cpp b/src/resources/inventory/inventory.cpp
index 97bb255fe..df7104d03 100644
--- a/src/resources/inventory/inventory.cpp
+++ b/src/resources/inventory/inventory.cpp
@@ -492,8 +492,12 @@ void Inventory::virtualRestore(const Item *const item,
mVirtualRemove[index] -= amount;
if (mVirtualRemove[index] < 0)
mVirtualRemove.erase(index);
- if (index < 0 || index >= CAST_S32(mSize) || (mItems[index] == nullptr))
+ if (index < 0 ||
+ index >= CAST_S32(mSize) ||
+ mItems[index] == nullptr)
+ {
return;
+ }
mItems[index]->mQuantity += amount;
}
}