From d30e64a2be314eb17fa45274524108c054cebea1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 15 Sep 2013 15:26:51 +0300 Subject: add ability to select and heal nearest player. Fir this action need press Mod key (left shift) and help key (C). --- src/actionmanager.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/actionmanager.cpp') 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(); -- cgit v1.2.3-70-g09d2