summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/game.cpp b/src/game.cpp
index e2343f39..fb434be2 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -580,8 +580,9 @@ void Game::handleInput()
switch (tKey) {
case KeyboardConfig::KEY_PICKUP:
{
- Uint16 x = player_node->mX / 32;
- Uint16 y = player_node->mY / 32;
+ const Vector &pos = player_node->getPosition();
+ Uint16 x = (int) pos.x / 32;
+ Uint16 y = (int) pos.y / 32;
FloorItem *item =
floorItemManager->findByCoordinates(x, y);
@@ -754,7 +755,9 @@ void Game::handleInput()
// Get the state of the keyboard keys
keyboard.refreshActiveKeys();
- Uint16 x = player_node->mX / 32, y = player_node->mY / 32;
+ const Vector &pos = player_node->getPosition();
+ Uint16 x = (int) pos.x / 32;
+ Uint16 y = (int) pos.y / 32;
unsigned char direction = 0;