summaryrefslogtreecommitdiff
path: root/src/item.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/item.cpp')
-rw-r--r--src/item.cpp11
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();
+}