summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-01-01 10:49:36 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-01-01 10:49:36 +0000
commit73911893133028a855931b037ed4e90217d5503a (patch)
tree24eaed10128754db9436ea9bd333d169f041cc0c /src/game.cpp
parent768cf33e1b66994379ac757aae0589bee83a2e7f (diff)
downloadmana-client-73911893133028a855931b037ed4e90217d5503a.tar.gz
mana-client-73911893133028a855931b037ed4e90217d5503a.tar.bz2
mana-client-73911893133028a855931b037ed4e90217d5503a.tar.xz
mana-client-73911893133028a855931b037ed4e90217d5503a.zip
Third time is the charm; changed sprite direction code again.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 21b6008e..f708fabf 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -489,15 +489,17 @@ void Game::handleInput()
// If none below the player, try the tile in front of
// the player
- if (!item) {
- if (player_node->getDirection() & Being::UP)
- y--;
- if (player_node->getDirection() & Being::DOWN)
- y++;
- if (player_node->getDirection() & Being::LEFT)
- x--;
- if (player_node->getDirection() & Being::RIGHT)
- x++;
+ if (!item)
+ {
+ // Temporary until tile-based picking is removed.
+ switch (player_node->getSpriteDirection())
+ {
+ case DIRECTION_UP : --y; break;
+ case DIRECTION_DOWN : ++y; break;
+ case DIRECTION_LEFT : --x; break;
+ case DIRECTION_RIGHT: ++x; break;
+ default: break;
+ }
item = floorItemManager->findByCoordinates(x, y);
}