summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 25c1ebf7..683251ed 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -119,11 +119,10 @@ void Inventory::removeItemAt(int index)
{
delete mItems[index];
mItems[index] = 0;
- mUsed--;
- if (mUsed < 0) // Already at 0, no need to distribute event
- mUsed = 0;
- else
+ if (mUsed > 0) {
+ mUsed--;
distributeSlotsChangedEvent();
+ }
}
bool Inventory::contains(Item *item) const