summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-26 02:28:51 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-26 02:28:51 +0300
commit2018073c8ec531d936321f2e6561b68d386f36a5 (patch)
tree0e0c2522b1b2485da298046011f287a7c18a418d /src/actions
parente2dddbdd9599b9b1f6a9825ee06d4d3616d9d1dd (diff)
downloadmv-2018073c8ec531d936321f2e6561b68d386f36a5.tar.gz
mv-2018073c8ec531d936321f2e6561b68d386f36a5.tar.bz2
mv-2018073c8ec531d936321f2e6561b68d386f36a5.tar.xz
mv-2018073c8ec531d936321f2e6561b68d386f36a5.zip
Move chat command /heal into actions.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/actions.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index 2eda2b6f3..251204df4 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -236,7 +236,14 @@ impHandler0(heal)
{
if (actorManager)
{
- if (inputManager.isActionActive(InputAction::STOP_ATTACK))
+ if (!event.args.empty())
+ {
+ const Being *const being = actorManager->findBeingByName(
+ event.args, ActorType::PLAYER);
+ if (being)
+ actorManager->heal(being);
+ }
+ else if (inputManager.isActionActive(InputAction::STOP_ATTACK))
{
Being *target = localPlayer->getTarget();
if (!target || target->getType() != ActorType::PLAYER)
@@ -247,8 +254,11 @@ impHandler0(heal)
localPlayer->setTarget(target);
}
}
+ else
+ {
+ actorManager->heal(localPlayer);
+ }
- actorManager->healTarget();
if (Game::instance())
Game::instance()->setValidSpeed();
return true;