From 38c7345e781e9f6e645f703ffe178849a2140301 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 24 Dec 2013 15:23:26 +0300 Subject: add support for warp pets if distance very long. New pet db option: warpDistance --- src/being/being.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/being') 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) { -- cgit v1.2.3-60-g2f50