summaryrefslogtreecommitdiff
path: root/src/item.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-03-16 12:07:38 +0300
committerAndrei Karas <akaras@inbox.ru>2014-03-16 12:07:38 +0300
commitcf9b1182f06b1336f0d1071c267ea36c990430fa (patch)
tree56adfed2bb031a4a45380db53cda3f5a9eb6a2e9 /src/item.cpp
parenta8df8e90356a048c48ac5ea1a1a8649a1a5b742b (diff)
downloadmv-cf9b1182f06b1336f0d1071c267ea36c990430fa.tar.gz
mv-cf9b1182f06b1336f0d1071c267ea36c990430fa.tar.bz2
mv-cf9b1182f06b1336f0d1071c267ea36c990430fa.tar.xz
mv-cf9b1182f06b1336f0d1071c267ea36c990430fa.zip
Add missing consts into item.
Diffstat (limited to 'src/item.cpp')
-rw-r--r--src/item.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/item.cpp b/src/item.cpp
index fe2fcaa92..02c5d0c16 100644
--- a/src/item.cpp
+++ b/src/item.cpp
@@ -92,11 +92,12 @@ void Item::setId(const int id, const unsigned char color)
}
}
-bool Item::isHaveTag(const int tagId)
+bool Item::isHaveTag(const int tagId) const
{
- if (mTags.find(tagId) == mTags.end())
+ const std::map <int, int>::const_iterator it = mTags.find(tagId);
+ if (it == mTags.end())
return false;
- return mTags[tagId] > 0;
+ return (*it).second > 0;
}
Image *Item::getImage(const int id, const unsigned char color)
@@ -112,7 +113,7 @@ Image *Item::getImage(const int id, const unsigned char color)
return image;
}
-std::string Item::getName()
+std::string Item::getName() const
{
const ItemInfo &info = ItemDB::get(mId);
if (serverVersion > 0)