summaryrefslogtreecommitdiff
path: root/src/net/tradehandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tradehandler.cpp')
-rw-r--r--src/net/tradehandler.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/net/tradehandler.cpp b/src/net/tradehandler.cpp
index c3fd6d4b..5bce0574 100644
--- a/src/net/tradehandler.cpp
+++ b/src/net/tradehandler.cpp
@@ -38,13 +38,15 @@ std::string tradePartnerName;
/**
* Listener for request trade dialogs
*/
-struct RequestTradeListener : public gcn::ActionListener
-{
- void action(const std::string& eventId)
+namespace {
+ struct RequestTradeListener : public gcn::ActionListener
{
- player_node->tradeReply(eventId == "yes");
- };
-} requestTradeListener;
+ void action(const std::string& eventId)
+ {
+ player_node->tradeReply(eventId == "yes");
+ };
+ } listener;
+}
TradeHandler::TradeHandler()
{
@@ -77,14 +79,14 @@ void TradeHandler::handleMessage(MessageIn *msg)
player_node->tradeReply(false);
break;
}
-
+
player_node->setTrading(true);
tradePartnerName = msg->readString(24);
ConfirmDialog *dlg;
dlg = new ConfirmDialog("Request for trade",
tradePartnerName +
" wants to trade with you, do you accept?");
- dlg->addActionListener(&requestTradeListener);
+ dlg->addActionListener(&listener);
break;
case SMSG_TRADE_RESPONSE: