summaryrefslogtreecommitdiff
path: root/src/net/manaserv/charhandler.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-08-19 02:37:09 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-08-19 02:37:09 +0200
commit27114fa2694318f2a1c56cb828a3b79731efcb74 (patch)
treeaad31af84a5932bf8fda83e367dfa1ac78fec1c3 /src/net/manaserv/charhandler.cpp
parent36239b2d689b862a951a65a9be7376a500f1ace9 (diff)
downloadmana-27114fa2694318f2a1c56cb828a3b79731efcb74.tar.gz
mana-27114fa2694318f2a1c56cb828a3b79731efcb74.tar.bz2
mana-27114fa2694318f2a1c56cb828a3b79731efcb74.tar.xz
mana-27114fa2694318f2a1c56cb828a3b79731efcb74.zip
Fixed visible equipment updates, and made it based on equip.xml.
Diffstat (limited to 'src/net/manaserv/charhandler.cpp')
-rw-r--r--src/net/manaserv/charhandler.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/net/manaserv/charhandler.cpp b/src/net/manaserv/charhandler.cpp
index 79f3b35a..b1ddc96a 100644
--- a/src/net/manaserv/charhandler.cpp
+++ b/src/net/manaserv/charhandler.cpp
@@ -34,6 +34,8 @@
#include "net/manaserv/connection.h"
#include "net/manaserv/gamehandler.h"
+#include "net/manaserv/beinghandler.h"
+#include "net/manaserv/inventoryhandler.h"
#include "net/manaserv/messagein.h"
#include "net/manaserv/messageout.h"
#include "net/manaserv/manaserv_protocol.h"
@@ -355,17 +357,19 @@ void CharHandler::switchCharacter()
unsigned int CharHandler::baseSprite() const
{
- return SPRITE_BASE;
+ return SPRITE_LAYER_BASE;
}
unsigned int CharHandler::hairSprite() const
{
- return SPRITE_HAIR;
+ return SPRITE_LAYER_HAIR;
}
unsigned int CharHandler::maxSprite() const
{
- return SPRITE_VECTOREND;
+ static unsigned int visibleSlots = FIXED_SPRITE_LAYER_SIZE
+ + Net::getInventoryHandler()->getVisibleSlotsNumber();
+ return visibleSlots;
}
void CharHandler::updateCharacters()
@@ -387,7 +391,7 @@ void CharHandler::updateCharacters()
LocalPlayer *player = character->dummy = new LocalPlayer;
player->setName(info.name);
player->setGender(info.gender);
- player->setSprite(SPRITE_HAIR, info.hairStyle * -1,
+ player->setSprite(SPRITE_LAYER_HAIR, info.hairStyle * -1,
ColorDB::get(info.hairColor));
character->data.mAttributes[LEVEL] = info.level;
character->data.mAttributes[CHAR_POINTS] = info.characterPoints;