summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2010-10-31 12:11:54 +0100
committerStefan Dombrowski <stefan@uni-bonn.de>2010-10-31 12:11:54 +0100
commit1f69108501c4bf51f3adac9ffbf7a7631fb12b9a (patch)
tree0155fe575006f6ddf9b3c57f374ad09daeebb3e3 /src/localplayer.cpp
parent1fa380950a37405b6b8921867b844e4c1a162263 (diff)
downloadmana-client-1f69108501c4bf51f3adac9ffbf7a7631fb12b9a.tar.gz
mana-client-1f69108501c4bf51f3adac9ffbf7a7631fb12b9a.tar.bz2
mana-client-1f69108501c4bf51f3adac9ffbf7a7631fb12b9a.tar.xz
mana-client-1f69108501c4bf51f3adac9ffbf7a7631fb12b9a.zip
Using tile coordinates for pick-up
Since the tile coordinates are already avaible the calculation is not needed. Furthermore this avoids the correction of the tile, which was needed because the pixel coordinates are meant as coordinates for drawing the being. This resolves http://bugs.manasource.org/view.php?id=249 Reviewed-by: Thorbjorn
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 5f5f44ae..7826596c 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -707,8 +707,8 @@ void LocalPlayer::setInvItem(int index, int id, int amount)
void LocalPlayer::pickUp(FloorItem *item)
{
- int dx = item->getX() - (int) getPosition().x / mMap->getTileWidth();
- int dy = item->getY() - ((int) getPosition().y - 1) / mMap->getTileHeight();
+ int dx = item->getX() - getTileX();
+ int dy = item->getY() - getTileY();
if (dx * dx + dy * dy < 4)
{