summaryrefslogtreecommitdiff
path: root/src/actions/target.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-20 22:26:00 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-20 22:26:00 +0300
commitc4a9748e841fd8620e7e9d230aad8964f424bb08 (patch)
treedeeeac5217f0d73e5c5176399685ee74bea36460 /src/actions/target.cpp
parent2ac58b6b39b155a9033677f225fe5c56b63cb6b1 (diff)
downloadplus-c4a9748e841fd8620e7e9d230aad8964f424bb08.tar.gz
plus-c4a9748e841fd8620e7e9d230aad8964f424bb08.tar.bz2
plus-c4a9748e841fd8620e7e9d230aad8964f424bb08.tar.xz
plus-c4a9748e841fd8620e7e9d230aad8964f424bb08.zip
Add function for selecting new target.
Diffstat (limited to 'src/actions/target.cpp')
-rw-r--r--src/actions/target.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/actions/target.cpp b/src/actions/target.cpp
index f5bf636d4..a0615143c 100644
--- a/src/actions/target.cpp
+++ b/src/actions/target.cpp
@@ -35,16 +35,8 @@ namespace Actions
static bool setTarget(const ActorTypeT type, const AllowSort allowSort)
{
- if (actorManager && localPlayer)
- {
- Being *const target = actorManager->findNearestLivingBeing(
- localPlayer, 20, type, allowSort);
-
- if (target && target != localPlayer->getTarget())
- localPlayer->setTarget(target);
-
- return true;
- }
+ if (localPlayer)
+ return localPlayer->setNewTarget(type, allowSort) != nullptr;
return false;
}