diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-22 21:59:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-22 21:59:47 +0300 |
commit | 8bc005b59bd27533a19354318e17a5cb5cfa09c5 (patch) | |
tree | f2c7357610554a414b3ce61bd151f1e9976290f2 /src/being/being.cpp | |
parent | 4545b34b1533657d58788285a38b5128f49070a8 (diff) | |
download | mv-8bc005b59bd27533a19354318e17a5cb5cfa09c5.tar.gz mv-8bc005b59bd27533a19354318e17a5cb5cfa09c5.tar.bz2 mv-8bc005b59bd27533a19354318e17a5cb5cfa09c5.tar.xz mv-8bc005b59bd27533a19354318e17a5cb5cfa09c5.zip |
Add pet actor type. For now it works almost same like monsters.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r-- | src/being/being.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
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 ""; } |