diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-12-31 15:00:31 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-12-31 15:00:31 +0300 |
commit | 332334a876da21687911c6d22cf4a5dcb2cb586a (patch) | |
tree | a139c3d8562d2c9ca73b3b5f6ba079034b4bb684 /src/being | |
parent | 6e4517d3f46f11fc47b77e92bd2c439fdb5738b2 (diff) | |
download | manaplus-332334a876da21687911c6d22cf4a5dcb2cb586a.tar.gz manaplus-332334a876da21687911c6d22cf4a5dcb2cb586a.tar.bz2 manaplus-332334a876da21687911c6d22cf4a5dcb2cb586a.tar.xz manaplus-332334a876da21687911c6d22cf4a5dcb2cb586a.zip |
add pet offset if owner is moving.
New pet db attributes: moveOffsetX, moveOffsetY
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/being.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 439cbd2c9..600de11e8 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -3246,15 +3246,27 @@ void Being::fixPetSpawnPos(int &dstX, int &dstY) const int offsetX1; int offsetY1; - if (mOwner->getCurrentAction() == SIT) + switch (mOwner->getCurrentAction()) { - offsetX1 = mInfo->getSitOffsetX(); - offsetY1 = mInfo->getSitOffsetY(); - } - else - { - offsetX1 = mInfo->getTargetOffsetX(); - offsetY1 = mInfo->getTargetOffsetY(); + case SIT: + offsetX1 = mInfo->getSitOffsetX(); + offsetY1 = mInfo->getSitOffsetY(); + break; + + case MOVE: + offsetX1 = mInfo->getMoveOffsetX(); + offsetY1 = mInfo->getMoveOffsetY(); + break; + + case ATTACK: + case DEAD: + case SPAWN: + case HURT: + case STAND: + default: + offsetX1 = mInfo->getTargetOffsetX(); + offsetY1 = mInfo->getTargetOffsetY(); + break; } int offsetX = offsetX1; |