summaryrefslogtreecommitdiff
path: root/src/item.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-27 03:36:52 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-27 03:36:52 +0200
commit1b57518ca97c670174f89c5af28659b6ad0c3d42 (patch)
tree369c6e2f8cfbd791f252de68c0f85bd1af47c351 /src/item.cpp
parent037248d338291529e0c044a80ca8345abe05dd2b (diff)
downloadmanaverse-1b57518ca97c670174f89c5af28659b6ad0c3d42.tar.gz
manaverse-1b57518ca97c670174f89c5af28659b6ad0c3d42.tar.bz2
manaverse-1b57518ca97c670174f89c5af28659b6ad0c3d42.tar.xz
manaverse-1b57518ca97c670174f89c5af28659b6ad0c3d42.zip
Implement receiving item color from server.
Diffstat (limited to 'src/item.cpp')
-rw-r--r--src/item.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/item.cpp b/src/item.cpp
index 79540334a..c3c9b9c18 100644
--- a/src/item.cpp
+++ b/src/item.cpp
@@ -29,7 +29,8 @@
#include "resources/resourcemanager.h"
#include "configuration.h"
-Item::Item(int id, int quantity, int refine, bool equipment, bool equipped):
+Item::Item(int id, int quantity, int refine, unsigned char color,
+ bool equipment, bool equipped):
mImage(0),
mDrawImage(0),
mQuantity(quantity),
@@ -39,7 +40,7 @@ Item::Item(int id, int quantity, int refine, bool equipment, bool equipped):
mRefine(refine),
mInvIndex(0)
{
- setId(id);
+ setId(id, color);
}
Item::~Item()
@@ -48,9 +49,10 @@ Item::~Item()
mImage->decRef();
}
-void Item::setId(int id)
+void Item::setId(int id, unsigned char color)
{
mId = id;
+ mColor = color;
// Types 0 and 1 are not equippable items.
mEquipment = id && getInfo().getType() >= 2;