summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/pets.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/actions/pets.cpp b/src/actions/pets.cpp
index 84b3d412d..f0e9cbb15 100644
--- a/src/actions/pets.cpp
+++ b/src/actions/pets.cpp
@@ -143,8 +143,20 @@ impHandler(catchPet)
return false;
Being *target = nullptr;
- if (!event.args.empty())
- target = actorManager->findNearestByName(event.args);
+ const std::string args = event.args;
+ if (!args.empty())
+ {
+ if (args[0] == ':')
+ {
+ target = actorManager->findBeing(fromInt(atoi(
+ args.substr(1).c_str()), BeingId));
+ }
+ else
+ {
+ target = actorManager->findNearestByName(args);
+ }
+ }
+
if (!target)
target = localPlayer->getTarget();
else