summaryrefslogtreecommitdiff
path: root/src/gui/buy.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-09-17 13:51:37 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-09-17 13:51:37 +0000
commite846d4502b59a1a3b8d658a37ae5b5ce4aa1c00c (patch)
tree8feb8b51d731057412a59aeddbbe83b75b09912a /src/gui/buy.cpp
parent3bfcee0d9c033a46fe1b13795d89909c8fb6a239 (diff)
downloadmana-e846d4502b59a1a3b8d658a37ae5b5ce4aa1c00c.tar.gz
mana-e846d4502b59a1a3b8d658a37ae5b5ce4aa1c00c.tar.bz2
mana-e846d4502b59a1a3b8d658a37ae5b5ce4aa1c00c.tar.xz
mana-e846d4502b59a1a3b8d658a37ae5b5ce4aa1c00c.zip
Completed transition to use MessageOut.
Diffstat (limited to 'src/gui/buy.cpp')
-rw-r--r--src/gui/buy.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp
index 3a32824a..c825c82e 100644
--- a/src/gui/buy.cpp
+++ b/src/gui/buy.cpp
@@ -38,7 +38,9 @@
#include "../resources/iteminfo.h"
#include "../resources/itemmanager.h"
+#include "../net/messageout.h"
#include "../net/network.h"
+#include "../net/protocol.h"
BuyDialog::BuyDialog():
@@ -235,10 +237,11 @@ void BuyDialog::action(const std::string& eventId)
// there a better way to ensure this fails in an _obivous_ way in C++?
else if (eventId == "buy" && (m_amountItems > 0 &&
m_amountItems <= m_maxItems)) {
- writeWord(0, 0x00c8);
- writeWord(2, 8);
- writeWord(4, m_amountItems);
- writeWord(6, shopInventory[selectedItem].id);
+ MessageOut outMsg;
+ outMsg.writeShort(CMSG_NPC_BUY_REQUEST);
+ outMsg.writeShort(8);
+ outMsg.writeShort(m_amountItems);
+ outMsg.writeShort(shopInventory[selectedItem].id);
writeSet(8);
// update money !