diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-12-25 12:35:27 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-12-25 12:35:27 +0300 |
commit | 5c0999cb674ceb43d2244e4eaba225f8ffa4ccb4 (patch) | |
tree | a2bcd31ace81a4a3df29ff4c580d6d57cb10a0b0 /src | |
parent | 219424dc0e194a722bc93ba51b973fda8715869f (diff) | |
download | manaverse-5c0999cb674ceb43d2244e4eaba225f8ffa4ccb4.tar.gz manaverse-5c0999cb674ceb43d2244e4eaba225f8ffa4ccb4.tar.bz2 manaverse-5c0999cb674ceb43d2244e4eaba225f8ffa4ccb4.tar.xz manaverse-5c0999cb674ceb43d2244e4eaba225f8ffa4ccb4.zip |
extend pet follow logic with follow in fixed position to owner.
Diffstat (limited to 'src')
-rw-r--r-- | src/being/being.cpp | 44 | ||||
-rw-r--r-- | src/resources/db/petdb.cpp | 2 |
2 files changed, 26 insertions, 20 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index b7d6019ec..a8b3eaf8c 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1650,28 +1650,34 @@ void Being::petLogic() } else if (divX > followDist || divY > followDist) { - if (divX > followDist) + if (!dist) { - if (dstX > mX + dist) - dstX -= dist; - else if (dstX + dist <= mX) - dstX += dist; + fixPetSpawnPos(dstX, dstY); } else { - dstX = mX; - } - - if (divY > followDist) - { - if (dstY > mY + dist) - dstY -= dist; - else if (dstX + dist <= mX) - dstY += dist; - } - else - { - dstY = mY; + if (divX > followDist) + { + if (dstX > mX + dist) + dstX -= dist; + else if (dstX + dist <= mX) + dstX += dist; + } + else + { + dstX = mX; + } + if (divY > followDist) + { + if (dstY > mY + dist) + dstY -= dist; + else if (dstX + dist <= mX) + dstY += dist; + } + else + { + dstY = mY; + } } const int walkMask = getWalkMask(); @@ -3191,7 +3197,7 @@ void Being::fixPetSpawnPos(int &dstX, int &dstY) const switch (mOwner->getDirection()) { case LEFT: - offsetX = offsetY1; + offsetX = -offsetY1; offsetY = -offsetX1; break; case RIGHT: diff --git a/src/resources/db/petdb.cpp b/src/resources/db/petdb.cpp index eeb8af9a0..d50c44dc7 100644 --- a/src/resources/db/petdb.cpp +++ b/src/resources/db/petdb.cpp @@ -85,7 +85,7 @@ void PETDB::load() currentInfo->setStartFollowDist(XML::getProperty(petNode, "startFollowDistance", 3)); currentInfo->setFollowDist(XML::getProperty(petNode, - "followDistance", 1)); + "followDistance", 0)); currentInfo->setWarpDist(XML::getProperty(petNode, "warpDistance", 11)); |