diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-07-27 16:28:37 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-07-27 16:28:37 +0000 |
commit | ab74313ac96b5259f17555085f1fdb9780cd387c (patch) | |
tree | 1f37e7b19dd889f170d5339d5a33bd9984637d30 | |
parent | a0a365b5e89896a40d6f30be29184506bdc6214d (diff) | |
download | mana-ab74313ac96b5259f17555085f1fdb9780cd387c.tar.gz mana-ab74313ac96b5259f17555085f1fdb9780cd387c.tar.bz2 mana-ab74313ac96b5259f17555085f1fdb9780cd387c.tar.xz mana-ab74313ac96b5259f17555085f1fdb9780cd387c.zip |
Target the nearest monster on joystick button 3v0.0.25
Should be made configurable later (Mantis 151)
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/game.cpp | 15 |
2 files changed, 11 insertions, 8 deletions
@@ -1,3 +1,7 @@ +2008-07-27 Bjørn Lindeijer <bjorn@lindeijer.nl> + + * src/game.cpp: Target the nearest monster on joystick button 3. + 2008-07-25 Bjørn Lindeijer <bjorn@lindeijer.nl> * src/winver.h, README, configure.ac, data/help/changes.txt, diff --git a/src/game.cpp b/src/game.cpp index 0773b8e7..37375ca2 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -810,12 +810,11 @@ void Game::handleInput() player_node->attack(target, newTarget); } - // Target the nearest player if 'q' is pressed - if ( keyboard.isKeyActive(keyboard.KEY_TARGET_PLAYER) ) - //if (keys[SDLK_q]) + // Target the nearest player + if (keyboard.isKeyActive(keyboard.KEY_TARGET_PLAYER)) { - Being *target = - beingManager->findNearestLivingBeing(player_node, 20, Being::PLAYER); + Being *target = beingManager->findNearestLivingBeing( + player_node, 20, Being::PLAYER); if (target) { @@ -823,9 +822,9 @@ void Game::handleInput() } } - // Target the nearest monster if 'a' pressed - if ( keyboard.isKeyActive(keyboard.KEY_TARGET_CLOSEST) ) - //if (keys[SDLK_a]) + // Target the nearest monster + if (keyboard.isKeyActive(keyboard.KEY_TARGET_CLOSEST) + || (joystick && joystick->buttonPressed(3))) { Being *target = beingManager->findNearestLivingBeing(x, y, 20, Being::MONSTER); |