summaryrefslogtreecommitdiff
path: root/src/being/localplayer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-05 17:09:19 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-05 17:09:19 +0300
commite6e26d83c4aa11ab3c78fc1faa0da7c090358974 (patch)
tree1b7f5ca13826575fe101314aa2e520a935a8325a /src/being/localplayer.cpp
parent8480ff2ce8ac1ce1ceba024eddfaeb62a5d20f8d (diff)
downloadmv-e6e26d83c4aa11ab3c78fc1faa0da7c090358974.tar.gz
mv-e6e26d83c4aa11ab3c78fc1faa0da7c090358974.tar.bz2
mv-e6e26d83c4aa11ab3c78fc1faa0da7c090358974.tar.xz
mv-e6e26d83c4aa11ab3c78fc1faa0da7c090358974.zip
Simplify navigateTo methods in LocalPlayer.
Diffstat (limited to 'src/being/localplayer.cpp')
-rw-r--r--src/being/localplayer.cpp30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 446deec36..831d2a0d8 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -1169,7 +1169,7 @@ void LocalPlayer::moveToTarget(int dist)
if (dist == 0)
{
if (mTarget)
- navigateTo(mTarget);
+ navigateTo(mTarget->getTileX(), mTarget->getTileY());
}
else
{
@@ -2564,34 +2564,6 @@ bool LocalPlayer::navigateTo(const int x, const int y)
return !mNavigatePath.empty();
}
-void LocalPlayer::navigateTo(const Being *const being)
-{
- if (!mMap || !being)
- return;
-
- SpecialLayer *const tmpLayer = mMap->getTempLayer();
- if (!tmpLayer)
- return;
-
- const Vector &playerPos = getPosition();
- mShowNavigePath = true;
- mOldX = static_cast<int>(playerPos.x);
- mOldY = static_cast<int>(playerPos.y);
- mOldTileX = mX;
- mOldTileY = mY;
- mNavigateX = being->getTileX();
- mNavigateY = being->getTileY();
-
- mNavigatePath = mMap->findPath(
- static_cast<int>(playerPos.x - mapTileSize / 2) / mapTileSize,
- static_cast<int>(playerPos.y - mapTileSize) / mapTileSize,
- being->getTileX(), being->getTileY(),
- getBlockWalkMask(), 0);
-
- if (mDrawPath)
- tmpLayer->addRoad(mNavigatePath);
-}
-
void LocalPlayer::navigateClean()
{
if (!mMap)