summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-11 01:09:29 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-11 01:09:29 +0300
commit9ce9d5563195bf9d7d22356252f38bc95b247527 (patch)
tree984014cbb799fefaa62d3e8f8c7820ed2b6407c1 /src/net/ea
parentfc199c3ae60d4c4cf76236c7f4891113daa3cbc4 (diff)
downloadmv-9ce9d5563195bf9d7d22356252f38bc95b247527.tar.gz
mv-9ce9d5563195bf9d7d22356252f38bc95b247527.tar.bz2
mv-9ce9d5563195bf9d7d22356252f38bc95b247527.tar.xz
mv-9ce9d5563195bf9d7d22356252f38bc95b247527.zip
imporve tradehandler class.
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/tradehandler.cpp11
-rw-r--r--src/net/ea/tradehandler.h2
2 files changed, 7 insertions, 6 deletions
diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp
index 961f8ff62..b4aca1041 100644
--- a/src/net/ea/tradehandler.cpp
+++ b/src/net/ea/tradehandler.cpp
@@ -67,7 +67,8 @@ TradeHandler::TradeHandler()
confirmDlg = nullptr;
}
-void TradeHandler::removeItem(int slotNum A_UNUSED, int amount A_UNUSED)
+void TradeHandler::removeItem(const int slotNum A_UNUSED,
+ const int amount A_UNUSED) const
{
// TODO
}
@@ -87,7 +88,7 @@ void TradeHandler::processTradeRequest(Net::MessageIn &msg)
{
if (PlayerInfo::isTrading() || confirmDlg)
{
- Net::getTradeHandler()->respond(false);
+ respond(false);
return;
}
@@ -106,13 +107,13 @@ void TradeHandler::processTradeRequest(Net::MessageIn &msg)
}
else
{
- Net::getTradeHandler()->respond(true);
+ respond(true);
}
}
}
else
{
- Net::getTradeHandler()->respond(false);
+ respond(false);
return;
}
}
@@ -123,7 +124,7 @@ void TradeHandler::processTradeResponse(Net::MessageIn &msg)
|| !player_relations.hasPermission(tradePartnerName,
PlayerRelation::TRADE))
{
- Net::getTradeHandler()->respond(false);
+ respond(false);
return;
}
diff --git a/src/net/ea/tradehandler.h b/src/net/ea/tradehandler.h
index 7253f4e0a..b7be2704e 100644
--- a/src/net/ea/tradehandler.h
+++ b/src/net/ea/tradehandler.h
@@ -37,7 +37,7 @@ class TradeHandler : public Net::TradeHandler
A_DELETE_COPY(TradeHandler)
- void removeItem(int slotNum, int amount);
+ void removeItem(const int slotNum, const int amount) const override;
void processTradeRequest(Net::MessageIn &msg);