summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-28 18:48:09 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-28 18:48:09 +0300
commit36f19b67df5ba7b00e91d9a234088f276b8bf513 (patch)
treee6bcba65ee03e34bcb0b7566090e17798cf182ce /src/game.cpp
parent39c0baaad44c49c41ac9311bcf39c2844a49e921 (diff)
downloadplus-36f19b67df5ba7b00e91d9a234088f276b8bf513.tar.gz
plus-36f19b67df5ba7b00e91d9a234088f276b8bf513.tar.bz2
plus-36f19b67df5ba7b00e91d9a234088f276b8bf513.tar.xz
plus-36f19b67df5ba7b00e91d9a234088f276b8bf513.zip
Add untarget key. By default unassigned.
It remove targeting but not stop server side attack.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 81f987376..0527e8481 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -1148,6 +1148,7 @@ void Game::handleInput()
&& !NpcDialog::isAnyInputFocused()
&& (!player_node || !player_node->getAwayMode())
&& !keyboard.isKeyActive(keyboard.KEY_TARGET)
+ && !keyboard.isKeyActive(keyboard.KEY_UNTARGET)
&& !InventoryWindow::isAnyInputFocused())
{
// const int tKey = keyboard.getKeyIndex(event.key.keysym.sym);
@@ -1611,7 +1612,8 @@ void Game::handleInput()
keyboard.isKeyActive(keyboard.KEY_TARGET_CLOSEST) ||
keyboard.isKeyActive(keyboard.KEY_TARGET_NPC) ||
(joystick && joystick->buttonPressed(3))) &&
- !keyboard.isKeyActive(keyboard.KEY_TARGET))
+ !keyboard.isKeyActive(keyboard.KEY_TARGET) &&
+ !keyboard.isKeyActive(keyboard.KEY_UNTARGET))
{
ActorSprite::Type currentTarget = ActorSprite::UNKNOWN;
if (keyboard.isKeyActive(keyboard.KEY_TARGET_CLOSEST) ||
@@ -1663,10 +1665,12 @@ void Game::handleInput()
// Stop attacking if the right key is pressed
if (!keyboard.isKeyActive(keyboard.KEY_ATTACK)
- && keyboard.isKeyActive(keyboard.KEY_TARGET)
&& !keyboard.isKeyActive(keyboard.KEY_EMOTE))
{
- player_node->stopAttack();
+ if (keyboard.isKeyActive(keyboard.KEY_TARGET))
+ player_node->stopAttack();
+ else if (keyboard.isKeyActive(keyboard.KEY_UNTARGET))
+ player_node->untarget();
}
if (joystick)