summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-23 17:42:56 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-23 17:42:56 +0300
commit0d154a04d5f82c485c3b43cc601d4d4ea801360d (patch)
tree629e918684bd03bc8d096b5f78345c67b1253b28
parent7f889f92a410de52b45093d1592bd3cceeecba4f (diff)
downloadmanaplus-0d154a04d5f82c485c3b43cc601d4d4ea801360d.tar.gz
manaplus-0d154a04d5f82c485c3b43cc601d4d4ea801360d.tar.bz2
manaplus-0d154a04d5f82c485c3b43cc601d4d4ea801360d.tar.xz
manaplus-0d154a04d5f82c485c3b43cc601d4d4ea801360d.zip
Use petdb for drawing pets.
-rw-r--r--src/being/being.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 102a5b440..fd71e5f9a 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -303,7 +303,7 @@ void Being::setSubtype(const uint16_t subtype, const uint8_t look)
mSubType = subtype;
mLook = look;
- if (mType == ActorType::Monster || mType == ActorType::Pet)
+ if (mType == ActorType::Monster)
{
mInfo = MonsterDB::get(mSubType);
if (mInfo)
@@ -314,6 +314,17 @@ void Being::setSubtype(const uint16_t subtype, const uint8_t look)
mYDiff = mInfo->getSortOffsetY();
}
}
+ if (mType == ActorType::Pet)
+ {
+ mInfo = PETDB::get(mSubType);
+ if (mInfo)
+ {
+ setName(mInfo->getName());
+ setupSpriteDisplay(mInfo->getDisplay(), true, 0,
+ mInfo->getColor(mLook));
+ mYDiff = mInfo->getSortOffsetY();
+ }
+ }
else if (mType == ActorType::Mercenary)
{
mInfo = MercenaryDB::get(mSubType);