diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-09-15 15:26:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-09-15 15:26:51 +0300 |
commit | d30e64a2be314eb17fa45274524108c054cebea1 (patch) | |
tree | 36ef230b5ca5ea023e6a852a089df99d74922095 | |
parent | 1b06805d4c1bf43b9694dbcdd568112a75293cab (diff) | |
download | manaplus-d30e64a2be314eb17fa45274524108c054cebea1.tar.gz manaplus-d30e64a2be314eb17fa45274524108c054cebea1.tar.bz2 manaplus-d30e64a2be314eb17fa45274524108c054cebea1.tar.xz manaplus-d30e64a2be314eb17fa45274524108c054cebea1.zip |
add ability to select and heal nearest player.
Fir this action need press Mod key (left shift) and help key (C).
-rw-r--r-- | src/actionmanager.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp index d0fdfeddb..3e675429e 100644 --- a/src/actionmanager.cpp +++ b/src/actionmanager.cpp @@ -371,6 +371,18 @@ impHandler0(heal) { if (actorSpriteManager) { + if (inputManager.isActionActive(Input::KEY_MOD)) + { + Being *target = player_node->getTarget(); + if (!target || target->getType() != ActorSprite::PLAYER) + { + target = actorSpriteManager->findNearestLivingBeing( + player_node, 10, ActorSprite::PLAYER); + if (target) + player_node->setTarget(target); + } + } + actorSpriteManager->healTarget(); if (Game::instance()) Game::instance()->setValidSpeed(); |