From e6e26d83c4aa11ab3c78fc1faa0da7c090358974 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 5 Aug 2014 17:09:19 +0300 Subject: Simplify navigateTo methods in LocalPlayer. --- src/being/localplayer.cpp | 30 +----------------------------- src/being/localplayer.h | 2 -- 2 files changed, 1 insertion(+), 31 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(playerPos.x); - mOldY = static_cast(playerPos.y); - mOldTileX = mX; - mOldTileY = mY; - mNavigateX = being->getTileX(); - mNavigateY = being->getTileY(); - - mNavigatePath = mMap->findPath( - static_cast(playerPos.x - mapTileSize / 2) / mapTileSize, - static_cast(playerPos.y - mapTileSize) / mapTileSize, - being->getTileX(), being->getTileY(), - getBlockWalkMask(), 0); - - if (mDrawPath) - tmpLayer->addRoad(mNavigatePath); -} - void LocalPlayer::navigateClean() { if (!mMap) diff --git a/src/being/localplayer.h b/src/being/localplayer.h index 63d122f44..5cb29339b 100644 --- a/src/being/localplayer.h +++ b/src/being/localplayer.h @@ -248,8 +248,6 @@ class LocalPlayer final : public Being, bool navigateTo(const int x, const int y); - void navigateTo(const Being *const being); - void navigateClean(); void imitateEmote(const Being *const being, -- cgit v1.2.3-70-g09d2