summaryrefslogtreecommitdiff
path: root/src/gui/npclistdialog.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-02-25 13:38:55 -0700
committerJared Adams <jaxad0127@gmail.com>2009-02-25 13:38:55 -0700
commitf04a8713ffc83db8b3dc4a472b28aad25a2b2bd1 (patch)
tree1822aa7cecfbe4ef38b55216ab82b686e3b636c7 /src/gui/npclistdialog.cpp
parent9673149ea3c28f42f38fc9989faf76d68e72bd20 (diff)
downloadmana-client-f04a8713ffc83db8b3dc4a472b28aad25a2b2bd1.tar.gz
mana-client-f04a8713ffc83db8b3dc4a472b28aad25a2b2bd1.tar.bz2
mana-client-f04a8713ffc83db8b3dc4a472b28aad25a2b2bd1.tar.xz
mana-client-f04a8713ffc83db8b3dc4a472b28aad25a2b2bd1.zip
Fix NPC handling to not need a handle on the NPC
The Being ID is used instead, as that is all that was ever really needed.
Diffstat (limited to 'src/gui/npclistdialog.cpp')
-rw-r--r--src/gui/npclistdialog.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/npclistdialog.cpp b/src/gui/npclistdialog.cpp
index 8349cb4a..fc7d2979 100644
--- a/src/gui/npclistdialog.cpp
+++ b/src/gui/npclistdialog.cpp
@@ -31,13 +31,16 @@
#include "../npc.h"
+#include "../net/messageout.h"
+#include "../net/protocol.h"
+
#include "../utils/gettext.h"
#include "../utils/strprintf.h"
extern NpcTextDialog *npcTextDialog;
-NpcListDialog::NpcListDialog():
- Window(_("NPC"))
+NpcListDialog::NpcListDialog(Network *network):
+ Window(_("NPC")), mNetwork(network)
{
setResizable(true);
@@ -115,7 +118,10 @@ void NpcListDialog::action(const gcn::ActionEvent &event)
{
setVisible(false);
reset();
- current_npc->dialogChoice(choice);
+ MessageOut outMsg(mNetwork);
+ outMsg.writeInt16(CMSG_NPC_LIST_CHOICE);
+ outMsg.writeInt32(current_npc);
+ outMsg.writeInt8(choice);
}
}