From 8bc425ff48b7a874ca0fb9d2285044c75f3010ab Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Sat, 13 Feb 2010 15:04:58 -0700 Subject: Make NPC dialogs instance instead of global This change allows players to talk to multiple NPCs at a time (if the server agrees). Manaserv's netcode allows multiple commerce instances too. eAthena's is limited to one commerce instance, due to protocol limitations. --- src/net/manaserv/playerhandler.cpp | 43 -------------------------------------- 1 file changed, 43 deletions(-) (limited to 'src/net/manaserv/playerhandler.cpp') diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp index 23158cc5..bff9512e 100644 --- a/src/net/manaserv/playerhandler.cpp +++ b/src/net/manaserv/playerhandler.cpp @@ -29,11 +29,9 @@ #include "particle.h" #include "npc.h" -#include "gui/buy.h" #include "gui/chat.h" #include "gui/gui.h" #include "gui/okdialog.h" -#include "gui/sell.h" #include "gui/viewport.h" #include "net/net.h" @@ -43,13 +41,6 @@ #include "net/manaserv/messageout.h" #include "net/manaserv/protocol.h" -extern OkDialog *weightNotice; -extern OkDialog *deathNotice; - -extern BuyDialog *buyDialog; -extern SellDialog *sellDialog; -extern Window *buySellDialog; - /** @see in game.cpp */ extern const int MILLISECONDS_IN_A_TICK; @@ -61,38 +52,6 @@ extern const int MILLISECONDS_IN_A_TICK; */ static const int MAP_TELEPORT_SCROLL_DISTANCE = 8 * 32; -/** - * Listener used for handling the overweigth message. - */ -// TODO Move somewhere else -namespace { - struct WeightListener : public gcn::ActionListener - { - void action(const gcn::ActionEvent &event) - { - weightNotice = NULL; - } - } weightListener; -} - -/** - * Listener used for handling death message. - */ -// TODO Move somewhere else -namespace { - struct DeathListener : public gcn::ActionListener - { - void action(const gcn::ActionEvent &event) - { - Net::getPlayerHandler()->respawn(); - deathNotice = NULL; - buyDialog->setVisible(false); - sellDialog->setVisible(false); - current_npc = 0; - } - } deathListener; -} - extern Net::PlayerHandler *playerHandler; namespace ManaServ { @@ -313,8 +272,6 @@ void PlayerHandler::handleMapChangeMessage(Net::MessageIn &msg) // Switch the actual map, deleting the previous one game->changeMap(mapName); - current_npc = 0; - const Vector &playerPos = player_node->getPosition(); float scrollOffsetX = 0.0f; float scrollOffsetY = 0.0f; -- cgit v1.2.3-60-g2f50