summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
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);
+}