diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-01-01 10:49:36 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-01-01 10:49:36 +0000 |
commit | 73911893133028a855931b037ed4e90217d5503a (patch) | |
tree | 24eaed10128754db9436ea9bd333d169f041cc0c /src/game.cpp | |
parent | 768cf33e1b66994379ac757aae0589bee83a2e7f (diff) | |
download | mana-73911893133028a855931b037ed4e90217d5503a.tar.gz mana-73911893133028a855931b037ed4e90217d5503a.tar.bz2 mana-73911893133028a855931b037ed4e90217d5503a.tar.xz mana-73911893133028a855931b037ed4e90217d5503a.zip |
Third time is the charm; changed sprite direction code again.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 20 |
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); } |