diff options
Diffstat (limited to 'src/net/buysellhandler.cpp')
-rw-r--r-- | src/net/buysellhandler.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/net/buysellhandler.cpp b/src/net/buysellhandler.cpp index b10c7ab9..be636d94 100644 --- a/src/net/buysellhandler.cpp +++ b/src/net/buysellhandler.cpp @@ -65,11 +65,11 @@ void BuySellHandler::handleMessage(MessageIn *msg) sellDialog->setVisible(false); sellDialog->reset(); buySellDialog->setVisible(true); - current_npc = dynamic_cast<NPC*>(beingManager->findBeing(msg->readInt32())); + current_npc = dynamic_cast<NPC*>(beingManager->findBeing(msg->readLong())); break; case SMSG_NPC_BUY: - msg->readInt16(); // length + msg->readShort(); // length n_items = (msg->getLength() - 4) / 11; buyDialog->reset(); buyDialog->setMoney(player_node->mGp); @@ -77,16 +77,16 @@ void BuySellHandler::handleMessage(MessageIn *msg) for (int k = 0; k < n_items; k++) { - Sint32 value = msg->readInt32(); - msg->readInt32(); // DCvalue - msg->readInt8(); // type - Sint16 itemId = msg->readInt16(); + Sint32 value = msg->readLong(); + msg->readLong(); // DCvalue + msg->readByte(); // type + Sint16 itemId = msg->readShort(); buyDialog->addItem(itemId, value); } break; case SMSG_NPC_SELL: - msg->readInt16(); // length + msg->readShort(); // length n_items = (msg->getLength() - 4) / 10; if (n_items > 0) { sellDialog->reset(); @@ -94,9 +94,9 @@ void BuySellHandler::handleMessage(MessageIn *msg) for (int k = 0; k < n_items; k++) { - Sint16 index = msg->readInt16(); - Sint32 value = msg->readInt32(); - msg->readInt32(); // 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->readInt8() == 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->readInt8() == 0) { + if (msg->readByte() == 0) { chatWindow->chatLog("Thanks for selling", BY_SERVER); } else { chatWindow->chatLog("Unable to sell", BY_SERVER); |