From a3e0ab99334d7c2d33a0bf206b711eff420a86c4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 22 Sep 2011 20:11:30 +0300 Subject: Improve speed on targeting monsters placed on same tile with player. --- src/localplayer.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/localplayer.cpp') diff --git a/src/localplayer.cpp b/src/localplayer.cpp index e17cf09c4..5aea98fbb 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -3413,6 +3413,9 @@ int LocalPlayer::getPathLength(Being* being) const Vector &playerPos = getPosition(); + if (being->mX == mX && being->mY == mY) + return 0; + Path debugPath = mMap->findPath( static_cast(playerPos.x - 16) / 32, static_cast(playerPos.y - 32) / 32, -- cgit v1.2.3-70-g09d2