summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-02-28 21:59:42 -0700
committerJared Adams <jaxad0127@gmail.com>2010-02-28 22:34:30 -0700
commit33b5868a46feb75bc939495c0a3650379e1e56e1 (patch)
tree5e8ab52f8e86eef5b990a28a1208dd276364218f /src
parentd32203d2e6539aa22953b9c04df000f79e85bf66 (diff)
downloadmana-33b5868a46feb75bc939495c0a3650379e1e56e1.tar.gz
mana-33b5868a46feb75bc939495c0a3650379e1e56e1.tar.bz2
mana-33b5868a46feb75bc939495c0a3650379e1e56e1.tar.xz
mana-33b5868a46feb75bc939495c0a3650379e1e56e1.zip
Fix item pickup
Reviewed-by: Freeyorp
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/game.cpp b/src/game.cpp
index e753e1f7..2b9e932e 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -601,8 +601,12 @@ void Game::handleInput()
case KeyboardConfig::KEY_PICKUP:
{
const Vector &pos = player_node->getPosition();
- Uint16 x = (int) pos.x / 32;
- Uint16 y = (int) pos.y / 32;
+ Map *map = viewport->getCurrentMap();
+ Uint16 x = (int) pos.x / map->getTileWidth();
+ Uint16 y = (int) (pos.y - 1)
+ / map->getTileHeight();
+ // y - 1 needed to fix position, otherwise, it's
+ // off under eAthena.
FloorItem *item =
floorItemManager->findByCoordinates(x, y);