From 53fce496581e70f0d99bf91152cc6d7e802e0974 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 25 Aug 2014 22:49:39 +0300 Subject: Move chat command /target into actions. --- src/actions/commands.cpp | 11 +++++++++++ src/actions/commands.h | 1 + 2 files changed, 12 insertions(+) (limited to 'src/actions') diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 712850a9f..4ae5d0f49 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -286,4 +286,15 @@ impHandler(move) return false; } +impHandler(setTarget) +{ + if (!actorManager || !localPlayer) + return false; + + Being *const target = actorManager->findNearestByName(event.args); + if (target) + localPlayer->setTarget(target); + return true; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index 35bd27538..8ff28cd00 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -39,6 +39,7 @@ namespace Actions decHandler(present); decHandler(printAll); decHandler(move); + decHandler(setTarget); } // namespace Actions #undef decHandler -- cgit v1.2.3-70-g09d2