summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-01-28 17:34:39 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-01-28 19:02:27 +0100
commit4502951aed77f18175adb601f0e094fd921c360d (patch)
tree111f0efad74dad24932f5685f572e4c4031d7a49 /src/net/tmwa
parentafdb517a87836995de7a94921cb2bfb2f9a2d56a (diff)
downloadmana-client-4502951aed77f18175adb601f0e094fd921c360d.tar.gz
mana-client-4502951aed77f18175adb601f0e094fd921c360d.tar.bz2
mana-client-4502951aed77f18175adb601f0e094fd921c360d.tar.xz
mana-client-4502951aed77f18175adb601f0e094fd921c360d.zip
Moved mTrading into the TradeHandler
Really only the trade handler is concerned about whether the player is currently in a trade or not. Reviewed-by: Erik Schilling
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/tradehandler.cpp12
-rw-r--r--src/net/tmwa/tradehandler.h3
2 files changed, 9 insertions, 6 deletions
diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp
index e8fb2145..66772468 100644
--- a/src/net/tmwa/tradehandler.cpp
+++ b/src/net/tmwa/tradehandler.cpp
@@ -98,14 +98,14 @@ void TradeHandler::handleMessage(Net::MessageIn &msg)
if (player_relations.hasPermission(tradePartnerName,
PlayerRelation::TRADE))
{
- if (PlayerInfo::isTrading() || confirmDlg)
+ if (mTrading || confirmDlg)
{
Net::getTradeHandler()->respond(false);
break;
}
tradePartnerName = tradePartnerNameTemp;
- PlayerInfo::setTrading(true);
+ mTrading = true;
confirmDlg = new ConfirmDialog(_("Request for Trade"),
strprintf(_("%s wants to trade with you, do you "
"accept?"), tradePartnerName.c_str()));
@@ -148,7 +148,7 @@ void TradeHandler::handleMessage(Net::MessageIn &msg)
// otherwise ignore silently
tradeWindow->setVisible(false);
- PlayerInfo::setTrading(false);
+ mTrading = false;
break;
default: // Shouldn't happen as well, but to be sure
SERVER_NOTICE(_("Unhandled trade cancel packet."))
@@ -224,14 +224,14 @@ void TradeHandler::handleMessage(Net::MessageIn &msg)
SERVER_NOTICE(_("Trade canceled."))
tradeWindow->setVisible(false);
tradeWindow->reset();
- PlayerInfo::setTrading(false);
+ mTrading = false;
break;
case SMSG_TRADE_COMPLETE:
SERVER_NOTICE(_("Trade completed."))
tradeWindow->setVisible(false);
tradeWindow->reset();
- PlayerInfo::setTrading(false);
+ mTrading = false;
break;
}
}
@@ -245,7 +245,7 @@ void TradeHandler::request(Being *being)
void TradeHandler::respond(bool accept)
{
if (!accept)
- PlayerInfo::setTrading(false);
+ mTrading = false;
MessageOut outMsg(CMSG_TRADE_RESPONSE);
outMsg.writeInt8(accept ? 3 : 4);
diff --git a/src/net/tmwa/tradehandler.h b/src/net/tmwa/tradehandler.h
index 801c03b7..443d763a 100644
--- a/src/net/tmwa/tradehandler.h
+++ b/src/net/tmwa/tradehandler.h
@@ -51,6 +51,9 @@ class TradeHandler : public MessageHandler, public Net::TradeHandler
void finish();
void cancel();
+
+ private:
+ bool mTrading;
};
} // namespace TmwAthena