summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/game.cpp b/src/game.cpp
index b12b114f..58c28640 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -43,6 +43,7 @@
#include "log.h"
#include "npc.h"
#include "particle.h"
+#include "player_relations.h"
#include "gui/buy.h"
#include "gui/buysell.h"
@@ -496,10 +497,16 @@ void Game::handleInput()
case SDLK_t:
// Toggle accepting of incoming trade requests
{
- TradeHandler *th = static_cast<TradeHandler*>(
- mTradeHandler.get());
- th->setAcceptTradeRequests(
- !th->acceptTradeRequests());
+ unsigned int deflt = player_relations.getDefault();
+ if (deflt & PlayerRelation::TRADE) {
+ chatWindow->chatLog("Ignoring incoming trade requests", BY_SERVER);
+ deflt &= ~PlayerRelation::TRADE;
+ } else {
+ chatWindow->chatLog("Accepting incoming trade requests", BY_SERVER);
+ deflt |= PlayerRelation::TRADE;
+ }
+
+ player_relations.setDefault(deflt);
}
used = true;
break;