summaryrefslogtreecommitdiff
path: root/src/gui/tradewindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-23 12:21:55 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-23 17:36:25 +0300
commit4c57a567eec8b3df0b0009b5520d647cccb83338 (patch)
tree6677639ab67b1209532d20d0ebffa52e4227cdc8 /src/gui/tradewindow.cpp
parenta685e41954590525f5a9f215dbd37a286ae2bd37 (diff)
downloadmv-4c57a567eec8b3df0b0009b5520d647cccb83338.tar.gz
mv-4c57a567eec8b3df0b0009b5520d647cccb83338.tar.bz2
mv-4c57a567eec8b3df0b0009b5520d647cccb83338.tar.xz
mv-4c57a567eec8b3df0b0009b5520d647cccb83338.zip
Add support for protecting items.
Protected item cant be selled, traded, dropped, used. Protect/unprotect item can be from context menu.
Diffstat (limited to 'src/gui/tradewindow.cpp')
-rw-r--r--src/gui/tradewindow.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/tradewindow.cpp b/src/gui/tradewindow.cpp
index 3c1ce60bb..a71b26f60 100644
--- a/src/gui/tradewindow.cpp
+++ b/src/gui/tradewindow.cpp
@@ -458,8 +458,11 @@ void TradeWindow::initTrade(const std::string &nick)
bool TradeWindow::checkItem(const Item *const item) const
{
+ const int itemId = item->getId();
+ if (PlayerInfo::isItemProtected(itemId))
+ return false;
const Item *const tItem = mMyInventory->findItem(
- item->getId(), item->getColor());
+ itemId, item->getColor());
if (tItem && (tItem->getQuantity() > 1
|| item->getQuantity() > 1))