summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-07 13:15:22 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-07 13:15:22 +0300
commit6f86c11e0ecee3c980cd7e3cfca8ef72e7aa8a02 (patch)
tree2d1923e799a43754b15728c8e6a23f9c283bd825 /src/actions
parentd9732855666b402c0a492d6618ce9ab930089219 (diff)
downloadmv-6f86c11e0ecee3c980cd7e3cfca8ef72e7aa8a02.tar.gz
mv-6f86c11e0ecee3c980cd7e3cfca8ef72e7aa8a02.tar.bz2
mv-6f86c11e0ecee3c980cd7e3cfca8ef72e7aa8a02.tar.xz
mv-6f86c11e0ecee3c980cd7e3cfca8ef72e7aa8a02.zip
Add into mobs and foring pets context menu item for timing pet.
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