diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-22 20:11:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-22 20:11:30 +0300 |
commit | a3e0ab99334d7c2d33a0bf206b711eff420a86c4 (patch) | |
tree | 4bf45f0e571b3e1710e7ff7656d6dd37b131b804 /src/localplayer.cpp | |
parent | b51739591b7573d0b97a13a7d22708461eea70e2 (diff) | |
download | plus-a3e0ab99334d7c2d33a0bf206b711eff420a86c4.tar.gz plus-a3e0ab99334d7c2d33a0bf206b711eff420a86c4.tar.bz2 plus-a3e0ab99334d7c2d33a0bf206b711eff420a86c4.tar.xz plus-a3e0ab99334d7c2d33a0bf206b711eff420a86c4.zip |
Improve speed on targeting monsters placed on same tile with player.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r-- | src/localplayer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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<int>(playerPos.x - 16) / 32, static_cast<int>(playerPos.y - 32) / 32, |