summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-10 22:46:50 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-10 22:46:50 +0300
commitb6df3c3999d4be067e7314e3887e583c13ad1624 (patch)
treef7f39237cbf1e08440882c295cf3d7a494a2585a /src/being.cpp
parent83a142e6917bed619aeb96e217850299eb2a63be (diff)
downloadplus-b6df3c3999d4be067e7314e3887e583c13ad1624.tar.gz
plus-b6df3c3999d4be067e7314e3887e583c13ad1624.tar.bz2
plus-b6df3c3999d4be067e7314e3887e583c13ad1624.tar.xz
plus-b6df3c3999d4be067e7314e3887e583c13ad1624.zip
add partial support for player looks.
Can get packets from server, but cant draw player.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp14
1 files changed, 11 insertions, 3 deletions
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);
+}