From 33b5868a46feb75bc939495c0a3650379e1e56e1 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Sun, 28 Feb 2010 21:59:42 -0700 Subject: Fix item pickup Reviewed-by: Freeyorp --- src/game.cpp | 8 ++++++-- 1 file 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); -- cgit v1.2.3-70-g09d2