summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-05-21 03:23:28 +0300
committerAndrei Karas <akaras@inbox.ru>2011-05-21 03:23:28 +0300
commit54f8367afe9d30c21bcda057872439199c7dd9c1 (patch)
tree63d0f02eca1cfd643e4a394c7999c9c172839086
parent61350cc4f65d53dd3add0c15558f6017b18ddbea (diff)
downloadmv-54f8367afe9d30c21bcda057872439199c7dd9c1.tar.gz
mv-54f8367afe9d30c21bcda057872439199c7dd9c1.tar.bz2
mv-54f8367afe9d30c21bcda057872439199c7dd9c1.tar.xz
mv-54f8367afe9d30c21bcda057872439199c7dd9c1.zip
Fix player build path in special collisions.
-rw-r--r--src/gui/viewport.cpp2
-rw-r--r--src/localplayer.cpp16
2 files changed, 9 insertions, 9 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 1053fa1c9..1f2d06894 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -306,7 +306,7 @@ void Viewport::_drawDebugPath(Graphics *graphics)
debugPath = mMap->findPath(
static_cast<int>(playerPos.x - 16) / 32,
static_cast<int>(playerPos.y - 32) / 32,
- mousePosX / 32, mousePosY / 32, 0, 500);
+ mousePosX / 32, mousePosY / 32, player_node->getWalkMask(), 500);
lastMouseDestination = mouseDestination;
}
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 544c67f97..9cae5d094 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -912,7 +912,7 @@ bool LocalPlayer::pickUp(FloorItem *item)
Path debugPath = mMap->findPath(
static_cast<int>(playerPos.x - 16) / 32,
static_cast<int>(playerPos.y - 32) / 32,
- item->getTileX(), item->getTileY(), 0x00, 0);
+ item->getTileX(), item->getTileY(), getWalkMask(), 0);
if (!debugPath.empty())
navigateTo(item->getTileX(), item->getTileY());
else
@@ -1725,7 +1725,7 @@ void LocalPlayer::moveToTarget(unsigned int dist)
{
debugPath = mMap->findPath(static_cast<int>(playerPos.x - 16) / 32,
static_cast<int>(playerPos.y - 32) / 32,
- mTarget->getTileX(), mTarget->getTileY(), 0x00, 0);
+ mTarget->getTileX(), mTarget->getTileY(), getWalkMask(), 0);
if (debugPath.size() < dist)
return;
@@ -2592,7 +2592,7 @@ bool LocalPlayer::isReachable(int x, int y, int maxCost)
Path debugPath = mMap->findPath(
static_cast<int>(playerPos.x - 16) / 32,
static_cast<int>(playerPos.y - 32) / 32,
- x, y, 0x00, maxCost);
+ x, y, getWalkMask(), maxCost);
return !debugPath.empty();
}
@@ -2627,7 +2627,7 @@ bool LocalPlayer::isReachable(Being *being, int maxCost)
Path debugPath = mMap->findPath(
static_cast<int>(playerPos.x - 16) / 32,
static_cast<int>(playerPos.y - 32) / 32,
- being->getTileX(), being->getTileY(), 0x00, maxCost);
+ being->getTileX(), being->getTileY(), getWalkMask(), maxCost);
being->setDistance(static_cast<int>(debugPath.size()));
if (!debugPath.empty())
@@ -3221,7 +3221,7 @@ bool LocalPlayer::navigateTo(int x, int y)
mNavigatePath = mMap->findPath(
static_cast<int>(playerPos.x - 16) / 32,
static_cast<int>(playerPos.y - 32) / 32,
- x, y, 0x00, 0);
+ x, y, getWalkMask(), 0);
if (mDrawPath)
tmpLayer->addRoad(mNavigatePath);
@@ -3250,7 +3250,7 @@ void LocalPlayer::navigateTo(Being *being)
static_cast<int>(playerPos.x - 16) / 32,
static_cast<int>(playerPos.y - 32) / 32,
being->getTileX(), being->getTileY(),
- 0x00, 0);
+ getWalkMask(), 0);
if (mDrawPath)
tmpLayer->addRoad(mNavigatePath);
@@ -3396,7 +3396,7 @@ int LocalPlayer::getPathLength(Being* being)
static_cast<int>(playerPos.x - 16) / 32,
static_cast<int>(playerPos.y - 32) / 32,
being->getTileX(), being->getTileY(),
- 0x00, 0);
+ getWalkMask(), 0);
return static_cast<int>(debugPath.size());
}
@@ -3735,7 +3735,7 @@ void LocalPlayer::fixAttackTarget()
static_cast<int>(playerPos.x - 16) / 32,
static_cast<int>(playerPos.y - 32) / 32,
mTarget->getTileX(), mTarget->getTileY(),
- 0x00, 0);
+ getWalkMask(), 0);
if (!debugPath.empty())
{