diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-10-10 19:00:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-10-10 19:31:42 +0300 |
commit | 675b9f793e5b36862294e4f0419c5cf2eab72164 (patch) | |
tree | 2750b8d336e6f670f4684a55800195f025cb846f /src/resources/db/itemdb.cpp | |
parent | 495110a8cb407548e227b062f6446b8eaa9605d0 (diff) | |
download | manaverse-675b9f793e5b36862294e4f0419c5cf2eab72164.tar.gz manaverse-675b9f793e5b36862294e4f0419c5cf2eab72164.tar.bz2 manaverse-675b9f793e5b36862294e4f0419c5cf2eab72164.tar.xz manaverse-675b9f793e5b36862294e4f0419c5cf2eab72164.zip |
Fix some asserts in text command editor.
Diffstat (limited to 'src/resources/db/itemdb.cpp')
-rw-r--r-- | src/resources/db/itemdb.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp index a98f0dad4..274b44bb2 100644 --- a/src/resources/db/itemdb.cpp +++ b/src/resources/db/itemdb.cpp @@ -801,6 +801,16 @@ bool ItemDB::exists(const int id) return i != mItemInfos.end(); } +bool ItemDB::exists(const std::string &name) +{ + if (!mLoaded) + return false; + + const NamedItemInfos::const_iterator i = mNamedItemInfos.find( + normalize(name)); + return i != mNamedItemInfos.end(); +} + const ItemInfo &ItemDB::get(const int id) { if (!mLoaded) |