summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-23 14:53:21 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-23 14:53:21 +0300
commit88df3eb6e82e1a23f379416652ac4f12f22a063c (patch)
tree130c1abe6ae6c4461910b244f6c322ede5f41466 /src/being.cpp
parent48f2996ccc789d740edc4b425a3e00f378a9095a (diff)
downloadManaVerse-88df3eb6e82e1a23f379416652ac4f12f22a063c.tar.gz
ManaVerse-88df3eb6e82e1a23f379416652ac4f12f22a063c.tar.bz2
ManaVerse-88df3eb6e82e1a23f379416652ac4f12f22a063c.tar.xz
ManaVerse-88df3eb6e82e1a23f379416652ac4f12f22a063c.zip
Add to monsters.xml and npcs.xml sort offset parameters.
sortOffsetY - this value will be substracted from y position while sorting deadSortOffsetY - this value will be substracted from dead bein y position while sorting By default sortOffsetY = 0 and deadSortOffsetY = 31
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 465ee42dd..b08e95e96 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -307,13 +307,17 @@ void Being::setSubtype(const uint16_t subtype)
{
setName(mInfo->getName());
setupSpriteDisplay(mInfo->getDisplay());
+ mYDiff = mInfo->getSortOffsetY();
}
}
else if (mType == NPC)
{
mInfo = NPCDB::get(mSubType);
if (mInfo)
+ {
setupSpriteDisplay(mInfo->getDisplay(), false);
+ mYDiff = mInfo->getSortOffsetY();
+ }
}
else if (mType == PLAYER)
{
@@ -1058,8 +1062,8 @@ void Being::setAction(const Action &action, const int attackType A_UNUSED)
currentAction = SpriteAction::DEAD;
if (mInfo)
sound.playSfx(mInfo->getSound(SOUND_EVENT_DIE), mX, mY);
- if (mType == MONSTER)
- mYDiff = 31;
+ if (mType == MONSTER || mType == NPC)
+ mYDiff = mInfo->getDeadSortOffsetY();
break;
case STAND:
currentAction = SpriteAction::STAND;