From 00d7badb647b4293c444c0374985b7f1ea8a1ed1 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 26 Aug 2006 16:36:05 +0000 Subject: Fixed player sprite not showing up. --- src/being.cpp | 2 +- src/being.h | 2 +- src/net/charserverhandler.cpp | 2 +- src/player.cpp | 9 +++++---- 4 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/being.cpp b/src/being.cpp index 70e3eb8e..87332c7a 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -46,7 +46,6 @@ PATH_NODE::PATH_NODE(Uint16 iX, Uint16 iY): } Being::Being(Uint32 id, Uint16 job, Map *map): - mSex(2), mJob(job), mX(0), mY(0), mDirection(DOWN), mAction(0), @@ -55,6 +54,7 @@ Being::Being(Uint32 id, Uint16 job, Map *map): mAttackSpeed(350), mEquipment(new Equipment()), mId(id), + mSex(2), mWeapon(0), mWalkSpeed(150), mMap(NULL), diff --git a/src/being.h b/src/being.h index 496f183d..b99f85a3 100644 --- a/src/being.h +++ b/src/being.h @@ -99,7 +99,6 @@ class Being : public Sprite static const char RIGHT = 8; std::string mName; /**< Name of character */ - Uint8 mSex; /**< Character's gender */ Uint16 mJob; /**< Job (player job, npc, monster, ) */ Uint16 mX, mY; /**< Tile coordinates */ Uint8 mDirection; /**< Facing direction */ @@ -357,6 +356,7 @@ class Being : public Sprite getSpriteDirection() const; Uint32 mId; /**< Unique sprite id */ + Uint8 mSex; /**< Character's gender */ Uint16 mWeapon; /**< Weapon picture id */ Uint16 mWalkSpeed; /**< Walking speed */ Map *mMap; /**< Map on which this being resides */ diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp index 5a2be683..1eea29b8 100644 --- a/src/net/charserverhandler.cpp +++ b/src/net/charserverhandler.cpp @@ -198,7 +198,7 @@ CharServerHandler::readPlayerData(MessageIn &msg, int &slot) LocalPlayer *tempPlayer = new LocalPlayer(mLoginData->account_ID, 0, NULL); slot = msg.readByte(); // character slot tempPlayer->mName = msg.readString(); - tempPlayer->mSex = msg.readByte(); + tempPlayer->setSex(msg.readByte()); tempPlayer->setHairStyle(msg.readByte()); tempPlayer->setHairColor(msg.readByte()); tempPlayer->mLevel = msg.readByte(); diff --git a/src/player.cpp b/src/player.cpp index 3f4abebb..46d3b938 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -35,10 +35,11 @@ Player::Player(Uint32 id, Uint16 job, Map *map): Being(id, job, map) { - // Load the weapon sprite. - // When there are more different weapons this should be moved to the - // setWeapon Method. - mSprites[WEAPON_SPRITE] = new AnimatedSprite("graphics/sprites/weapons.xml", 0); + /* Load the weapon sprite. When there are more different weapons this + * should be moved to the setWeapon Method. + */ + mSprites[WEAPON_SPRITE] = + new AnimatedSprite("graphics/sprites/weapons.xml", 0); } void -- cgit v1.2.3-70-g09d2