summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 6c97fa98..be0b312d 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -310,6 +310,15 @@ bool Being::delInventory(unsigned int itemId)
return false;
}
+bool Being::hasItem(unsigned int itemId) {
+ for (std::vector<unsigned int>::iterator i = inventory.begin();
+ i != inventory.end(); i++) {
+ if (*i == itemId)
+ return true;
+ }
+ return false;
+}
+
bool Being::equip(unsigned int itemId, unsigned char slot)
{
// currently this is too simplistic and doesn't check enough