summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/actions.cpp17
-rw-r--r--src/actions/actions.h1
2 files changed, 18 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
diff --git a/src/actions/actions.h b/src/actions/actions.h
index 04535700a..d03c8b8ac 100644
--- a/src/actions/actions.h
+++ b/src/actions/actions.h
@@ -88,6 +88,7 @@ namespace Actions
decHandler(uploadConfig);
decHandler(uploadServerConfig);
decHandler(uploadLog);
+ decHandler(catchPet);
} // namespace Actions
#undef decHandler