diff options
Diffstat (limited to 'src/actions/commands.cpp')
-rw-r--r-- | src/actions/commands.cpp | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index eafd0b82b..c8d4f2b21 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -37,11 +37,9 @@ #include "gui/widgets/tabs/chat/whispertab.h" #include "net/adminhandler.h" -#include "net/buysellhandler.h" #include "net/chathandler.h" #include "net/guildhandler.h" #include "net/homunculushandler.h" -#include "net/npchandler.h" #include "net/pethandler.h" #include "net/serverfeatures.h" @@ -713,67 +711,4 @@ impHandler0(fireHomunculus) return true; } -static Being *findBeing(const std::string &name) -{ - Being *being = nullptr; - if (name.empty()) - { - being = localPlayer->getTarget(); - } - else - { - being = actorManager->findBeingByName( - name, ActorType::Unknown); - } - if (!being) - { - being = actorManager->findNearestLivingBeing( - localPlayer, 1, ActorType::Npc, true); - } - if (!being) - { - being = actorManager->findNearestLivingBeing( - localPlayer, 1, ActorType::Player, true); - } - return being; -} - -impHandler(buy) -{ - Being *being = findBeing(event.args); - if (!being) - return false; - - if (being->getType() == ActorType::Npc) - { - npcHandler->buy(being->getId()); - return true; - } - else if (being->getType() == ActorType::Player) - { - buySellHandler->requestSellList(being->getName()); - return true; - } - return false; -} - -impHandler(sell) -{ - Being *being = findBeing(event.args); - if (!being) - return false; - - if (being->getType() == ActorType::Npc) - { - npcHandler->sell(being->getId()); - return true; - } - else if (being->getType() == ActorType::Player) - { - buySellHandler->requestBuyList(being->getName()); - return true; - } - return false; -} - } // namespace Actions |