summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2007-12-30 00:02:14 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2007-12-30 00:02:14 +0000
commit8d4dc1c28ee54f67c155b6759cf5776a917904ff (patch)
treeecf910e7214008c9a89f9d1bded37a8057abe1f2 /src/game.cpp
parent8e28cc3ac0f679cf35bc6a9ce1740ac7ae4aac47 (diff)
downloadmana-8d4dc1c28ee54f67c155b6759cf5776a917904ff.tar.gz
mana-8d4dc1c28ee54f67c155b6759cf5776a917904ff.tar.bz2
mana-8d4dc1c28ee54f67c155b6759cf5776a917904ff.tar.xz
mana-8d4dc1c28ee54f67c155b6759cf5776a917904ff.zip
Added a key for targeting the nearest player character based on patches by Trinexx. Some mapping fixes at snake dungeon map.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index b3fa6f07..52d70bc0 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -770,6 +770,19 @@ 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])
+ {
+ Being *target =
+ beingManager->findNearestLivingBeing(player_node, 20, Being::PLAYER);
+
+ if (target)
+ {
+ player_node->setTarget(target);
+ }
+ }
+
// Target the nearest monster if 'a' pressed
if ( keyboard.isKeyActive(keyboard.KEY_TARGET_CLOSEST) )
//if (keys[SDLK_a])