Commit ab74313ac96b5259f17555085f1fdb9780cd387c
- Diff rendering mode:
- inline
- side by side
ChangeLog
(4 / 0)
|   | |||
| 1 | 2008-07-27 Bjørn Lindeijer <bjorn@lindeijer.nl> | ||
| 2 | |||
| 3 | * src/game.cpp: Target the nearest monster on joystick button 3. | ||
| 4 | |||
| 1 | 5 | 2008-07-25 Bjørn Lindeijer <bjorn@lindeijer.nl> | |
| 2 | 6 | ||
| 3 | 7 | * src/winver.h, README, configure.ac, data/help/changes.txt, |
src/game.cpp
(7 / 8)
|   | |||
| 810 | 810 | player_node->attack(target, newTarget); | |
| 811 | 811 | } | |
| 812 | 812 | ||
| 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)) | ||
| 816 | 815 | { | |
| 817 | Being *target = | ||
| 818 | beingManager->findNearestLivingBeing(player_node, 20, Being::PLAYER); | ||
| 816 | Being *target = beingManager->findNearestLivingBeing( | ||
| 817 | player_node, 20, Being::PLAYER); | ||
| 819 | 818 | ||
| 820 | 819 | if (target) | |
| 821 | 820 | { | |
| … | … | ||
| 822 | 822 | } | |
| 823 | 823 | } | |
| 824 | 824 | ||
| 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))) | ||
| 828 | 828 | { | |
| 829 | 829 | Being *target = | |
| 830 | 830 | beingManager->findNearestLivingBeing(x, y, 20, Being::MONSTER); |

