summaryrefslogtreecommitdiff
path: root/src/being/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-12-24 15:23:26 +0300
committerAndrei Karas <akaras@inbox.ru>2013-12-24 15:23:26 +0300
commit38c7345e781e9f6e645f703ffe178849a2140301 (patch)
treefc62b7fc5b346cf755e5b33d3cf52b3550050838 /src/being/being.cpp
parenta1f5338e93e5f8b2bdac2c305824a925fd2e4141 (diff)
downloadmanaverse-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/being.cpp')
-rw-r--r--src/being/being.cpp9
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)
{