aboutsummaryrefslogtreecommitdiffstats
path: root/src/inventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index bf6b6bb..3995e3a 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -240,11 +240,12 @@ bool InventorySystem::take(const std::string& name, int count)
return ie.item != nullptr && ie.item->name == name;
});
- if (i == items.end())
+ if (i >= items.end())
break;
toDelete.push_front(i);
taken += i->count;
+ next = i + 1;
}
if (taken < count)