summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-17 13:25:09 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-17 13:25:09 +0300
commite0bd37fd01e8c14bf6d044382ac12cc11f5eaa43 (patch)
tree0d82a38a6ab5cbce04bc0eddad6de1cea8116720
parentb73f378c51a7fb74dc805ca6234cda5868a28fc9 (diff)
downloadmv-e0bd37fd01e8c14bf6d044382ac12cc11f5eaa43.tar.gz
mv-e0bd37fd01e8c14bf6d044382ac12cc11f5eaa43.tar.bz2
mv-e0bd37fd01e8c14bf6d044382ac12cc11f5eaa43.tar.xz
mv-e0bd37fd01e8c14bf6d044382ac12cc11f5eaa43.zip
Add static in buysellhandler.
-rw-r--r--src/net/ea/buysellhandler.cpp13
-rw-r--r--src/net/ea/buysellhandler.h10
-rw-r--r--src/net/eathena/buysellhandler.h2
-rw-r--r--src/net/tmwa/buysellhandler.h2
4 files changed, 15 insertions, 12 deletions
diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp
index 14378de4a..d4b660786 100644
--- a/src/net/ea/buysellhandler.cpp
+++ b/src/net/ea/buysellhandler.cpp
@@ -49,10 +49,13 @@
namespace Ea
{
-BuySellHandler::BuySellHandler() :
- mNpcId(0),
- mBuyDialog(nullptr)
+int BuySellHandler::mNpcId = 0;
+BuyDialog *BuySellHandler::mBuyDialog = nullptr;
+
+BuySellHandler::BuySellHandler()
{
+ mNpcId = 0;
+ mBuyDialog = nullptr;
}
void BuySellHandler::requestSellList(const std::string &nick) const
@@ -139,7 +142,7 @@ void BuySellHandler::processNpcBuySellChoice(Net::MessageIn &msg)
}
}
-void BuySellHandler::processNpcSell(Net::MessageIn &msg) const
+void BuySellHandler::processNpcSell(Net::MessageIn &msg)
{
msg.readInt16("len");
const int n_items = (msg.getLength() - 4) / 10;
@@ -168,7 +171,7 @@ void BuySellHandler::processNpcSell(Net::MessageIn &msg) const
}
}
-void BuySellHandler::processNpcBuyResponse(Net::MessageIn &msg) const
+void BuySellHandler::processNpcBuyResponse(Net::MessageIn &msg)
{
const uint8_t response = msg.readUInt8("response");
if (response == 0U)
diff --git a/src/net/ea/buysellhandler.h b/src/net/ea/buysellhandler.h
index 67400a1b3..5f941354b 100644
--- a/src/net/ea/buysellhandler.h
+++ b/src/net/ea/buysellhandler.h
@@ -51,15 +51,15 @@ class BuySellHandler notfinal : public Net::BuySellHandler
const ShopItem *const item,
const int amount) const override final;
- virtual void processNpcBuySellChoice(Net::MessageIn &msg);
+ static void processNpcBuySellChoice(Net::MessageIn &msg);
- virtual void processNpcSell(Net::MessageIn &msg) const;
+ static void processNpcSell(Net::MessageIn &msg);
- virtual void processNpcBuyResponse(Net::MessageIn &msg) const;
+ static void processNpcBuyResponse(Net::MessageIn &msg);
protected:
- int mNpcId;
- BuyDialog *mBuyDialog;
+ static int mNpcId;
+ static BuyDialog *mBuyDialog;
};
} // namespace Ea
diff --git a/src/net/eathena/buysellhandler.h b/src/net/eathena/buysellhandler.h
index 38e9f5da1..4db51b751 100644
--- a/src/net/eathena/buysellhandler.h
+++ b/src/net/eathena/buysellhandler.h
@@ -39,7 +39,7 @@ class BuySellHandler final : public MessageHandler, public Ea::BuySellHandler
void handleMessage(Net::MessageIn &msg);
- void processNpcBuy(Net::MessageIn &msg);
+ static void processNpcBuy(Net::MessageIn &msg);
static void processNpcSellResponse(Net::MessageIn &msg);
};
diff --git a/src/net/tmwa/buysellhandler.h b/src/net/tmwa/buysellhandler.h
index a0c99908f..f553541b8 100644
--- a/src/net/tmwa/buysellhandler.h
+++ b/src/net/tmwa/buysellhandler.h
@@ -39,7 +39,7 @@ class BuySellHandler final : public MessageHandler, public Ea::BuySellHandler
void handleMessage(Net::MessageIn &msg);
- void processNpcBuy(Net::MessageIn &msg);
+ static void processNpcBuy(Net::MessageIn &msg);
static void processNpcSellResponse(Net::MessageIn &msg);
};