diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-12-24 15:23:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-12-24 15:23:26 +0300 |
commit | 38c7345e781e9f6e645f703ffe178849a2140301 (patch) | |
tree | fc62b7fc5b346cf755e5b33d3cf52b3550050838 /src/being | |
parent | a1f5338e93e5f8b2bdac2c305824a925fd2e4141 (diff) | |
download | manaverse-38c7345e781e9f6e645f703ffe178849a2140301.tar.gz manaverse-38c7345e781e9f6e645f703ffe178849a2140301.tar.bz2 manaverse-38c7345e781e9f6e645f703ffe178849a2140301.tar.xz manaverse-38c7345e781e9f6e645f703ffe178849a2140301.zip |
add support for warp pets if distance very long.
New pet db option: warpDistance
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/being.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 2da3c644f..90c5cb316 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1630,10 +1630,17 @@ void Being::petLogic() int dstX = dstX0; int dstY = dstY0; const int followDist = mInfo->getStartFollowDist(); + const int warpDist = mInfo->getWarpDist(); const int dist = mInfo->getFollowDist(); const int divX = abs(dstX - mX); const int divY = abs(dstY - mY); - if (divX > followDist || divY > followDist) + + if (divX >= warpDist || divY >= warpDist) + { + setAction(Being::STAND, 0); + setTileCoords(dstX0, dstY0); + } + else if (divX > followDist || divY > followDist) { if (divX > followDist) { |