diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-05-07 20:20:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-05-07 20:20:09 +0300 |
commit | 860c60be6c7a925bb4d8db291b771a6044d20308 (patch) | |
tree | ddeb0b2bd54a4b66bd699b220050e4f952bb429f /src/item.cpp | |
parent | 6f9d0494f09833e29a05a2c06287fbee73cb7421 (diff) | |
download | manaplus-860c60be6c7a925bb4d8db291b771a6044d20308.tar.gz manaplus-860c60be6c7a925bb4d8db291b771a6044d20308.tar.bz2 manaplus-860c60be6c7a925bb4d8db291b771a6044d20308.tar.xz manaplus-860c60be6c7a925bb4d8db291b771a6044d20308.zip |
Add getName property to item and flooritem.
Diffstat (limited to 'src/item.cpp')
-rw-r--r-- | src/item.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/item.cpp b/src/item.cpp index cc7d666b5..fda05aa30 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -31,6 +31,8 @@ #include "debug.h" +extern int serverVersion; + Item::Item(int id, int quantity, int refine, unsigned char color, bool equipment, bool equipped): mImage(nullptr), @@ -113,3 +115,12 @@ Image *Item::getImage(int id, unsigned char color) image = Theme::getImageFromTheme("unknown-item.png"); return image; } + +std::string Item::getName() +{ + const ItemInfo &info = ItemDB::get(mId); + if (serverVersion > 0) + return info.getName(mColor); + else + return info.getName(); +} |