From 8bc005b59bd27533a19354318e17a5cb5cfa09c5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 22 Sep 2014 21:59:47 +0300 Subject: Add pet actor type. For now it works almost same like monsters. --- src/being/being.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/being/being.cpp') diff --git a/src/being/being.cpp b/src/being/being.cpp index 79b976049..102a5b440 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -222,10 +222,16 @@ Being::Being(const int id, setMap(map); setSubtype(subtype, 0); - if (mType == ActorType::Player || mType == ActorType::Mercenary) + if (mType == ActorType::Player + || mType == ActorType::Mercenary + || mType == ActorType::Pet) + { mShowName = config.getBoolValue("visiblenames"); + } else if (mType != ActorType::Npc) + { mGotComment = true; + } config.addListener("visiblenames", this); @@ -297,7 +303,7 @@ void Being::setSubtype(const uint16_t subtype, const uint8_t look) mSubType = subtype; mLook = look; - if (mType == ActorType::Monster) + if (mType == ActorType::Monster || mType == ActorType::Pet) { mInfo = MonsterDB::get(mSubType); if (mInfo) @@ -560,7 +566,9 @@ void Being::takeDamage(Being *const attacker, const int amount, color = &userPalette->getColor(UserPalette::MISS); } } - else if (mType == ActorType::Monster || mType == ActorType::Mercenary) + else if (mType == ActorType::Monster + || mType == ActorType::Mercenary + || mType == ActorType::Pet) { if (attacker == localPlayer) { @@ -2926,6 +2934,7 @@ std::string Being::loadComment(const std::string &name, case ActorType::LocalPet: case ActorType::Avatar: case ActorType::Mercenary: + case ActorType::Pet: default: return ""; } -- cgit v1.2.3-70-g09d2