summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-01-27 16:23:45 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-27 16:23:45 +0300
commit23af9b972ec8d4a1094aadf0d0171f16d82a7fcb (patch)
treeb4624e65abfb099a280183054fafe25f65299436 /src/actions
parentab608a29a138cd5db47fad949f1f3993d21af153 (diff)
downloadplus-23af9b972ec8d4a1094aadf0d0171f16d82a7fcb.tar.gz
plus-23af9b972ec8d4a1094aadf0d0171f16d82a7fcb.tar.bz2
plus-23af9b972ec8d4a1094aadf0d0171f16d82a7fcb.tar.xz
plus-23af9b972ec8d4a1094aadf0d0171f16d82a7fcb.zip
Improve undress popup menu item.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/actions.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index eb6404d37..77da32cd4 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -1155,9 +1155,24 @@ impHandler(undress)
if (!actorManager || !localPlayer)
return false;
+ const std::string args = event.args;
+
Being *target = nullptr;
- if (!event.args.empty())
- target = actorManager->findNearestByName(event.args);
+ if (!args.empty())
+ {
+ if (args[0] == ':')
+ {
+ target = actorManager->findBeing(fromInt(atoi(
+ args.substr(1).c_str()), BeingId));
+ if (target && target->getType() == ActorType::Monster)
+ target = nullptr;
+ }
+ else
+ {
+ target = actorManager->findNearestByName(event.args);
+ }
+ }
+
if (!target)
target = localPlayer->getTarget();
if (target && beingHandler)