From 9defd5c760e3ba0f01078a25a74320a55c1f4d82 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Fri, 8 Oct 2010 19:11:20 +0200 Subject: Fixing pick-up If the player wanted to pick up an item one tile up, then he moved to that tile before he picked it up. The same fix is already used in Game::handleInput() for KEY_PICKUP. TODO: Understand why the position is wrong. As a reminder I made a mantis ticket: http://bugs.manasource.org/view.php?id=249 --- src/localplayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/localplayer.cpp b/src/localplayer.cpp index b4418bbc..50a9462f 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 / 32; - int dy = item->getY() - (int) getPosition().y / 32; + int dx = item->getX() - (int) getPosition().x / mMap->getTileWidth(); + int dy = item->getY() - ((int) getPosition().y - 1) / mMap->getTileHeight(); if (dx * dx + dy * dy < 4) { -- cgit v1.2.3-70-g09d2