From 675b9f793e5b36862294e4f0419c5cf2eab72164 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 10 Oct 2017 19:00:20 +0300 Subject: Fix some asserts in text command editor. --- src/resources/db/itemdb.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/resources/db/itemdb.cpp') 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) -- cgit v1.2.3-70-g09d2