Commit ab74313ac96b5259f17555085f1fdb9780cd387c

Target the nearest monster on joystick button 3

Should be made configurable later (Mantis 151)
ChangeLog
(4 / 0)
  
12008-07-27 Bjørn Lindeijer <bjorn@lindeijer.nl>
2
3 * src/game.cpp: Target the nearest monster on joystick button 3.
4
152008-07-25 Bjørn Lindeijer <bjorn@lindeijer.nl>
26
37 * src/winver.h, README, configure.ac, data/help/changes.txt,
  
810810 player_node->attack(target, newTarget);
811811 }
812812
813 // Target the nearest player if 'q' is pressed
814 if ( keyboard.isKeyActive(keyboard.KEY_TARGET_PLAYER) )
815 //if (keys[SDLK_q])
813 // Target the nearest player
814 if (keyboard.isKeyActive(keyboard.KEY_TARGET_PLAYER))
816815 {
817 Being *target =
818 beingManager->findNearestLivingBeing(player_node, 20, Being::PLAYER);
816 Being *target = beingManager->findNearestLivingBeing(
817 player_node, 20, Being::PLAYER);
819818
820819 if (target)
821820 {
822822 }
823823 }
824824
825 // Target the nearest monster if 'a' pressed
826 if ( keyboard.isKeyActive(keyboard.KEY_TARGET_CLOSEST) )
827 //if (keys[SDLK_a])
825 // Target the nearest monster
826 if (keyboard.isKeyActive(keyboard.KEY_TARGET_CLOSEST)
827 || (joystick && joystick->buttonPressed(3)))
828828 {
829829 Being *target =
830830 beingManager->findNearestLivingBeing(x, y, 20, Being::MONSTER);