summaryrefslogtreecommitdiff
path: root/src/net/buysellhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/buysellhandler.cpp')
-rw-r--r--src/net/buysellhandler.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/net/buysellhandler.cpp b/src/net/buysellhandler.cpp
index 3b5fc87d..173c59d2 100644
--- a/src/net/buysellhandler.cpp
+++ b/src/net/buysellhandler.cpp
@@ -54,10 +54,10 @@ BuySellHandler::BuySellHandler()
handledMessages = _messages;
}
-void BuySellHandler::handleMessage(MessageIn *msg)
+void BuySellHandler::handleMessage(MessageIn &msg)
{
int n_items;
- switch (msg->getId())
+ switch (msg.getId())
{
case SMSG_NPC_BUY_SELL_CHOICE:
buyDialog->setVisible(false);
@@ -65,38 +65,38 @@ void BuySellHandler::handleMessage(MessageIn *msg)
sellDialog->setVisible(false);
sellDialog->reset();
buySellDialog->setVisible(true);
- current_npc = dynamic_cast<NPC*>(beingManager->findBeing(msg->readLong()));
+ current_npc = dynamic_cast<NPC*>(beingManager->findBeing(msg.readLong()));
break;
case SMSG_NPC_BUY:
- msg->readShort(); // length
- n_items = (msg->getLength() - 4) / 11;
+ msg.readShort(); // length
+ n_items = (msg.getLength() - 4) / 11;
buyDialog->reset();
buyDialog->setMoney(player_node->mMoney);
buyDialog->setVisible(true);
for (int k = 0; k < n_items; k++)
{
- Sint32 value = msg->readLong();
- msg->readLong(); // DCvalue
- msg->readByte(); // type
- Sint16 itemId = msg->readShort();
+ Sint32 value = msg.readLong();
+ msg.readLong(); // DCvalue
+ msg.readByte(); // type
+ Sint16 itemId = msg.readShort();
buyDialog->addItem(itemId, value);
}
break;
case SMSG_NPC_SELL:
- msg->readShort(); // length
- n_items = (msg->getLength() - 4) / 10;
+ msg.readShort(); // length
+ n_items = (msg.getLength() - 4) / 10;
if (n_items > 0) {
sellDialog->reset();
sellDialog->setVisible(true);
for (int k = 0; k < n_items; k++)
{
- Sint16 index = msg->readShort();
- Sint32 value = msg->readLong();
- msg->readLong(); // OCvalue
+ Sint16 index = msg.readShort();
+ Sint32 value = msg.readLong();
+ msg.readLong(); // OCvalue
Item *item = player_node->getInvItem(index);
if (item && !(item->isEquipped())) {
@@ -111,7 +111,7 @@ void BuySellHandler::handleMessage(MessageIn *msg)
break;
case SMSG_NPC_BUY_RESPONSE:
- if (msg->readByte() == 0) {
+ if (msg.readByte() == 0) {
chatWindow->chatLog("Thanks for buying", BY_SERVER);
} else {
chatWindow->chatLog("Unable to buy", BY_SERVER);
@@ -119,7 +119,7 @@ void BuySellHandler::handleMessage(MessageIn *msg)
break;
case SMSG_NPC_SELL_RESPONSE:
- if (msg->readByte() == 0) {
+ if (msg.readByte() == 0) {
chatWindow->chatLog("Thanks for selling", BY_SERVER);
} else {
chatWindow->chatLog("Unable to sell", BY_SERVER);