summaryrefslogtreecommitdiff
path: root/src/actions/actions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions/actions.cpp')
-rw-r--r--src/actions/actions.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index 250e43227..e3ad3a11a 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -1157,4 +1157,21 @@ impHandler(uploadLog)
return true;
}
+impHandler(catchPet)
+{
+ if (!localPlayer || !actorManager)
+ return false;
+
+ Being *target = nullptr;
+ if (!event.args.empty())
+ target = actorManager->findNearestByName(event.args);
+ if (!target)
+ target = localPlayer->getTarget();
+ else
+ localPlayer->setTarget(target);
+ if (target)
+ Net::getPetHandler()->catchPet(target);
+ return true;
+}
+
} // namespace Actions