From e846d4502b59a1a3b8d658a37ae5b5ce4aa1c00c Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Sat, 17 Sep 2005 13:51:37 +0000 Subject: Completed transition to use MessageOut. --- src/gui/buy.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/gui/buy.cpp') 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 ! -- cgit v1.2.3-70-g09d2