diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game.cpp | 8 |
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); |