diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-03 15:05:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-03 15:05:44 +0300 |
commit | 1694c27097eccab525f8bbe03ff050a0315a1c4f (patch) | |
tree | f641b2face23c2ced18eaeb946435ea836977fd7 /src/gui/windows | |
parent | 87c8c8423193109175cf8234160cd51ac561eb94 (diff) | |
download | manaplus-1694c27097eccab525f8bbe03ff050a0315a1c4f.tar.gz manaplus-1694c27097eccab525f8bbe03ff050a0315a1c4f.tar.bz2 manaplus-1694c27097eccab525f8bbe03ff050a0315a1c4f.tar.xz manaplus-1694c27097eccab525f8bbe03ff050a0315a1c4f.zip |
Not allow add equipped items to trade if presend server feature secure trades.
Diffstat (limited to 'src/gui/windows')
-rw-r--r-- | src/gui/windows/tradewindow.cpp | 13 |
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; } |