summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-25 23:07:02 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-25 23:07:02 +0300
commitb0ab41f03839163549de4344c027a69312458e77 (patch)
tree2e7d8ec9a61dd23c667f7967b52971cd297624ec /src/actions
parent53fce496581e70f0d99bf91152cc6d7e802e0974 (diff)
downloadmv-b0ab41f03839163549de4344c027a69312458e77.tar.gz
mv-b0ab41f03839163549de4344c027a69312458e77.tar.bz2
mv-b0ab41f03839163549de4344c027a69312458e77.tar.xz
mv-b0ab41f03839163549de4344c027a69312458e77.zip
Move chat command /atkhuman into actions.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/actions.cpp18
-rw-r--r--src/actions/actions.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index 188a46ea1..2eda2b6f3 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -431,6 +431,24 @@ impHandler0(targetAttack)
return false;
}
+impHandler0(attackHuman)
+{
+ if (!actorManager || !localPlayer)
+ return false;
+
+ Being *const target = actorManager->findNearestLivingBeing(
+ localPlayer, 10, ActorType::PLAYER, true);
+ if (target)
+ {
+ if (localPlayer->checAttackPermissions(target))
+ {
+ localPlayer->setTarget(target);
+ localPlayer->attack2(target, true);
+ }
+ }
+ return true;
+}
+
impHandler0(safeVideoMode)
{
if (mainGraphics)
diff --git a/src/actions/actions.h b/src/actions/actions.h
index 9b9c148b8..92d293df4 100644
--- a/src/actions/actions.h
+++ b/src/actions/actions.h
@@ -59,6 +59,7 @@ namespace Actions
decHandler(who);
decHandler(cleanGraphics);
decHandler(cleanFonts);
+ decHandler(attackHuman);
} // namespace Actions
#undef decHandler