From b0ab41f03839163549de4344c027a69312458e77 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 25 Aug 2014 23:07:02 +0300 Subject: Move chat command /atkhuman into actions. --- src/actions/actions.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/actions/actions.cpp') 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) -- cgit v1.2.3-70-g09d2