From b6df3c3999d4be067e7314e3887e583c13ad1624 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 10 Jun 2013 22:46:50 +0300 Subject: add partial support for player looks. Can get packets from server, but cant draw player. --- src/being.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index 309069a5a..37a1cb84d 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -167,6 +167,7 @@ Being::Being(const int id, const Type type, const uint16_t subtype, mHairColor(0), mPet(nullptr), mPetId(0), + mLook(0), mOwner(nullptr), mSpecialParticle(nullptr) { @@ -177,7 +178,7 @@ Being::Being(const int id, const Type type, const uint16_t subtype, } setMap(map); - setSubtype(subtype); + setSubtype(subtype, 0); if (mType == PLAYER) mShowName = config.getBoolValue("visiblenames"); @@ -224,15 +225,16 @@ Being::~Being() mPet->setOwner(nullptr); } -void Being::setSubtype(const uint16_t subtype) +void Being::setSubtype(const uint16_t subtype, const uint8_t look) { if (!mInfo) return; - if (subtype == mSubType) + if (subtype == mSubType && mLook == look) return; mSubType = subtype; + mLook = look; if (mType == MONSTER) { @@ -2893,3 +2895,9 @@ void Being::playSfx(const SoundInfo &sound, Being *const being, soundManager.playSfx(sound.sound, x, y); } } + +void Being::setLook(const int look) +{ + if (mType == PLAYER) + setSubtype(mSubType, look); +} -- cgit v1.2.3-60-g2f50