From 860c60be6c7a925bb4d8db291b771a6044d20308 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 7 May 2012 20:20:09 +0300 Subject: Add getName property to item and flooritem. --- src/item.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/item.cpp') 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(); +} -- cgit v1.2.3-60-g2f50