summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2011-01-22 21:20:51 +0100
committerStefan Dombrowski <stefan@uni-bonn.de>2011-01-22 21:20:51 +0100
commit760184661da4b96cc390ceb161646c8a83712acf (patch)
treee3e395ce9a5d7182c5e35732a53fb5aee41ff5de
parent0aa2c1373944b6d82793b91de744ce81d114474e (diff)
downloadmana-760184661da4b96cc390ceb161646c8a83712acf.tar.gz
mana-760184661da4b96cc390ceb161646c8a83712acf.tar.bz2
mana-760184661da4b96cc390ceb161646c8a83712acf.tar.xz
mana-760184661da4b96cc390ceb161646c8a83712acf.zip
Fixing pick-up with joystick
The pick-up with the joystick happend on the wrong tile. Bug was reported by Feufochmar on IRC.
-rw-r--r--src/game.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game.cpp b/src/game.cpp
index cd36dcdd..512b8b5f 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -779,9 +779,6 @@ void Game::handleInput()
return;
}
- const Vector &pos = player_node->getPosition();
- const Uint16 x = (int) pos.x / 32;
- const Uint16 y = (int) pos.y / 32;
unsigned char direction = 0;
// Translate pressed keys to movement and direction
@@ -899,6 +896,9 @@ void Game::handleInput()
{
if (joystick->buttonPressed(1))
{
+ const int x = player_node->getTileX();
+ const int y = player_node->getTileY();
+
FloorItem *item = floorItemManager->findByCoordinates(x, y);
if (item)