summaryrefslogtreecommitdiff
path: root/src/net/manaserv
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/manaserv
parentafdb517a87836995de7a94921cb2bfb2f9a2d56a (diff)
downloadmana-4502951aed77f18175adb601f0e094fd921c360d.tar.gz
mana-4502951aed77f18175adb601f0e094fd921c360d.tar.bz2
mana-4502951aed77f18175adb601f0e094fd921c360d.tar.xz
mana-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/manaserv')
-rw-r--r--src/net/manaserv/tradehandler.cpp8
-rw-r--r--src/net/manaserv/tradehandler.h1
2 files changed, 5 insertions, 4 deletions
diff --git a/src/net/manaserv/tradehandler.cpp b/src/net/manaserv/tradehandler.cpp
index 76870c84..b5d526ae 100644
--- a/src/net/manaserv/tradehandler.cpp
+++ b/src/net/manaserv/tradehandler.cpp
@@ -109,7 +109,7 @@ void TradeHandler::handleMessage(Net::MessageIn &msg)
respond(false);
break;
}
- PlayerInfo::setTrading(true);
+ mTrading = true;
tradePartnerName = being->getName();
tradePartnerID = being->getId();
ConfirmDialog *dlg = new ConfirmDialog(_("Request for Trade"),
@@ -148,14 +148,14 @@ void TradeHandler::handleMessage(Net::MessageIn &msg)
SERVER_NOTICE(_("Trade canceled."))
tradeWindow->setVisible(false);
tradeWindow->reset();
- PlayerInfo::setTrading(false);
+ mTrading = false;
break;
case GPMSG_TRADE_COMPLETE:
SERVER_NOTICE(_("Trade completed."))
tradeWindow->setVisible(false);
tradeWindow->reset();
- PlayerInfo::setTrading(false);
+ mTrading = false;
break;
}
}
@@ -176,7 +176,7 @@ void TradeHandler::respond(bool accept)
gameServerConnection->send(msg);
if (!accept)
- PlayerInfo::setTrading(false);
+ mTrading = false;
}
void TradeHandler::addItem(Item *item, int amount)
diff --git a/src/net/manaserv/tradehandler.h b/src/net/manaserv/tradehandler.h
index 4448592c..321b942f 100644
--- a/src/net/manaserv/tradehandler.h
+++ b/src/net/manaserv/tradehandler.h
@@ -68,6 +68,7 @@ class TradeHandler : public MessageHandler, public Net::TradeHandler
private:
bool mAcceptTradeRequests;
+ bool mTrading;
};
} // namespace ManaServ