diff options
author | Freeyorp <Freeyorp101@NOSPAM@hotmail.com> | 2009-05-10 13:45:00 +1200 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-05-09 19:54:26 -0600 |
commit | 59d351895a3a15b517c4493fab89a62137b12157 (patch) | |
tree | 2fc8e636c07a4e824eb4dd7357dc5d282db69d02 /src/game.cpp | |
parent | df9f7aa2d3f33f70b7aa9fd8ac7f1b7ddece0b29 (diff) | |
download | mana-59d351895a3a15b517c4493fab89a62137b12157.tar.gz mana-59d351895a3a15b517c4493fab89a62137b12157.tar.bz2 mana-59d351895a3a15b517c4493fab89a62137b12157.tar.xz mana-59d351895a3a15b517c4493fab89a62137b12157.zip |
Modify keyboard handling
The attack key now no longer changes the target if there is a target already set,
and changing the target to the same being now no longer cancels the target since
a dedicated Cancel Target Key now exists.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/game.cpp b/src/game.cpp index 3cfe2e3c..203629ff 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -920,24 +920,14 @@ void Game::handleInput() bool newTarget = !keyboard.isKeyActive(keyboard.KEY_TARGET); // A set target has highest priority - if (newTarget || !player_node->getTarget()) + if (!player_node->getTarget()) { Uint16 targetX = x, targetY = y; - switch (player_node->getSpriteDirection()) - { - case DIRECTION_UP : --targetY; break; - case DIRECTION_DOWN : ++targetY; break; - case DIRECTION_LEFT : --targetX; break; - case DIRECTION_RIGHT: ++targetX; break; - default: break; - } - // Only auto target Monsters target = beingManager->findNearestLivingBeing(targetX, targetY, 20, Being::MONSTER); } - player_node->attack(target, newTarget); } #endif |