summaryrefslogtreecommitdiff
path: root/src/gui/windows/tradewindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-03 15:05:44 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-03 15:05:44 +0300
commit1694c27097eccab525f8bbe03ff050a0315a1c4f (patch)
treef641b2face23c2ced18eaeb946435ea836977fd7 /src/gui/windows/tradewindow.cpp
parent87c8c8423193109175cf8234160cd51ac561eb94 (diff)
downloadmv-1694c27097eccab525f8bbe03ff050a0315a1c4f.tar.gz
mv-1694c27097eccab525f8bbe03ff050a0315a1c4f.tar.bz2
mv-1694c27097eccab525f8bbe03ff050a0315a1c4f.tar.xz
mv-1694c27097eccab525f8bbe03ff050a0315a1c4f.zip
Not allow add equipped items to trade if presend server feature secure trades.
Diffstat (limited to 'src/gui/windows/tradewindow.cpp')
-rw-r--r--src/gui/windows/tradewindow.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp
index 27a8c658e..fe0ca85f1 100644
--- a/src/gui/windows/tradewindow.cpp
+++ b/src/gui/windows/tradewindow.cpp
@@ -51,6 +51,7 @@
#include "resources/item/item.h"
+#include "net/serverfeatures.h"
#include "net/tradehandler.h"
#include "utils/delete2.h"
@@ -527,6 +528,18 @@ bool TradeWindow::checkItem(const Item *const item) const
}
return false;
}
+ if (serverFeatures->haveSecureTrades() &&
+ item->isEquipped() == Equipped_true)
+ {
+ if (localChatTab)
+ {
+ localChatTab->chatLog(
+ // TRANSLATORS: trade error
+ _("Failed adding item. You can not trade equipped items."),
+ ChatMsgType::BY_SERVER);
+ }
+ return false;
+ }
return true;
}