diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-01-27 16:23:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-01-27 16:23:45 +0300 |
commit | 23af9b972ec8d4a1094aadf0d0171f16d82a7fcb (patch) | |
tree | b4624e65abfb099a280183054fafe25f65299436 /src/actions | |
parent | ab608a29a138cd5db47fad949f1f3993d21af153 (diff) | |
download | ManaVerse-23af9b972ec8d4a1094aadf0d0171f16d82a7fcb.tar.gz ManaVerse-23af9b972ec8d4a1094aadf0d0171f16d82a7fcb.tar.bz2 ManaVerse-23af9b972ec8d4a1094aadf0d0171f16d82a7fcb.tar.xz ManaVerse-23af9b972ec8d4a1094aadf0d0171f16d82a7fcb.zip |
Improve undress popup menu item.
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/actions.cpp | 19 |
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) |