summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/actions.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index 3ee65a396..03944500d 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -561,8 +561,20 @@ impHandler(attack)
return false;
Being *target = nullptr;
- if (!event.args.empty())
- target = actorManager->findNearestByName(event.args);
+ std::string args = event.args;
+ if (!args.empty())
+ {
+ if (args[0] != ':')
+ {
+ target = actorManager->findNearestByName(args);
+ }
+ else
+ {
+ target = actorManager->findBeing(atoi(args.substr(1).c_str()));
+ if (target && target->getType() != ActorType::Monster)
+ target = nullptr;
+ }
+ }
if (!target)
target = localPlayer->getTarget();
else