diff options
-rw-r--r-- | src/actions/actions.cpp | 23 | ||||
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 1 |
2 files changed, 22 insertions, 2 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 003cd4a5d..cddaaddcb 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -58,6 +58,7 @@ #include "gui/windows/shopwindow.h" #include "gui/windows/shortcutwindow.h" #include "gui/windows/skilldialog.h" +#include "gui/windows/whoisonline.h" #include "gui/widgets/tabs/chat/chattab.h" @@ -617,9 +618,18 @@ impHandler0(ignoreInput) impHandler(buy) { - Being *being = findBeing(event.args); + const std::string args = event.args; + Being *being = findBeing(args); if (!being) + { + const std::set<std::string> &players = whoIsOnline->getOnlineNicks(); + if (players.find(args) != players.end()) + { + buySellHandler->requestSellList(args); + return true; + } return false; + } if (being->getType() == ActorType::Npc) { @@ -636,9 +646,18 @@ impHandler(buy) impHandler(sell) { - Being *being = findBeing(event.args); + const std::string args = event.args; + Being *being = findBeing(args); if (!being) + { + const std::set<std::string> &players = whoIsOnline->getOnlineNicks(); + if (players.find(args) != players.end()) + { + buySellHandler->requestBuyList(args); + return true; + } return false; + } if (being->getType() == ActorType::Npc) { diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index bccec33af..bc9b4d232 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -1583,6 +1583,7 @@ void PopupMenu::handleLink(const std::string &link, replaceAll(cmd, "'MAPY'", toString(mY)); } + logger->log("cmd: " + cmd); const size_t pos = cmd.find(' '); const std::string type(cmd, 0, pos); std::string args(cmd, pos == std::string::npos ? cmd.size() : pos + 1); |