From a39600b2ec8c71c74f2dad3569aba0fc0e8a9be4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 30 Aug 2014 00:01:16 +0300 Subject: Remove additional parameters from processNpcSell function. --- src/net/ea/buysellhandler.cpp | 7 ++++--- src/net/ea/buysellhandler.h | 3 +-- src/net/eathena/buysellhandler.cpp | 2 +- src/net/tmwa/buysellhandler.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp index f8a6651ef..e9c34ac7d 100644 --- a/src/net/ea/buysellhandler.cpp +++ b/src/net/ea/buysellhandler.cpp @@ -39,6 +39,8 @@ #include "net/chathandler.h" #include "net/net.h" +#include "net/ea/eaprotocol.h" + #include "utils/timer.h" #include "resources/notifytypes.h" @@ -138,8 +140,7 @@ void BuySellHandler::processNpcBuySellChoice(Net::MessageIn &msg) } } -void BuySellHandler::processNpcSell(Net::MessageIn &msg, - const int offset) const +void BuySellHandler::processNpcSell(Net::MessageIn &msg) const { msg.readInt16(); // length const int n_items = (msg.getLength() - 4) / 10; @@ -150,7 +151,7 @@ void BuySellHandler::processNpcSell(Net::MessageIn &msg, for (int k = 0; k < n_items; k++) { - const int index = msg.readInt16() - offset; + const int index = msg.readInt16() - INVENTORY_OFFSET; const int value = msg.readInt32(); msg.readInt32(); // value diff --git a/src/net/ea/buysellhandler.h b/src/net/ea/buysellhandler.h index 75e78a251..67400a1b3 100644 --- a/src/net/ea/buysellhandler.h +++ b/src/net/ea/buysellhandler.h @@ -53,8 +53,7 @@ class BuySellHandler notfinal : public Net::BuySellHandler virtual void processNpcBuySellChoice(Net::MessageIn &msg); - virtual void processNpcSell(Net::MessageIn &msg, - const int offset) const; + virtual void processNpcSell(Net::MessageIn &msg) const; virtual void processNpcBuyResponse(Net::MessageIn &msg) const; diff --git a/src/net/eathena/buysellhandler.cpp b/src/net/eathena/buysellhandler.cpp index a3d5dca23..f881738c9 100644 --- a/src/net/eathena/buysellhandler.cpp +++ b/src/net/eathena/buysellhandler.cpp @@ -73,7 +73,7 @@ void BuySellHandler::handleMessage(Net::MessageIn &msg) break; case SMSG_NPC_SELL: - processNpcSell(msg, INVENTORY_OFFSET); + processNpcSell(msg); break; case SMSG_NPC_BUY_RESPONSE: diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp index b59d0f1f9..4668c1829 100644 --- a/src/net/tmwa/buysellhandler.cpp +++ b/src/net/tmwa/buysellhandler.cpp @@ -75,7 +75,7 @@ void BuySellHandler::handleMessage(Net::MessageIn &msg) break; case SMSG_NPC_SELL: - processNpcSell(msg, INVENTORY_OFFSET); + processNpcSell(msg); break; case SMSG_NPC_BUY_RESPONSE: -- cgit v1.2.3-60-g2f50