diff options
-rw-r--r-- | src/actions/actions.cpp | 19 | ||||
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 6 |
2 files changed, 18 insertions, 7 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) diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index d1e23b558..74908fd98 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -1078,10 +1078,6 @@ void PopupMenu::handleLink(const std::string &link, { CREATEWIDGET(TextCommandEditor, mSpell); } - else if (link == "undress" && being) - { - beingHandler->undress(being); - } else if (link == "addcomment" && !mNick.empty()) { TextDialog *const dialog = CREATEWIDGETR(TextDialog, @@ -2593,7 +2589,7 @@ void PopupMenu::addPlayerMisc() mBrowserBox->addRow("items", _("Show Items")); // TRANSLATORS: popup menu item // TRANSLATORS: undress player - mBrowserBox->addRow("undress", _("Undress")); + mBrowserBox->addRow("/undress :'BEINGID'", _("Undress")); // TRANSLATORS: popup menu item // TRANSLATORS: add comment to player mBrowserBox->addRow("addcomment", _("Add comment")); |