diff options
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/target.cpp | 12 |
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; } |