diff options
author | Jan-Fabian Humann <malastare@gmx.net> | 2005-05-21 14:17:58 +0000 |
---|---|---|
committer | Jan-Fabian Humann <malastare@gmx.net> | 2005-05-21 14:17:58 +0000 |
commit | 75e8061f9413b0c7134465c48f41ba24410b2885 (patch) | |
tree | 299614c1a8fa80a1bccf6c4f3dd8b1a6df4706a6 /src/gui/trade.cpp | |
parent | e5f70463119360222400e6b3529b7ab8748317ae (diff) | |
download | mana-75e8061f9413b0c7134465c48f41ba24410b2885.tar.gz mana-75e8061f9413b0c7134465c48f41ba24410b2885.tar.bz2 mana-75e8061f9413b0c7134465c48f41ba24410b2885.tar.xz mana-75e8061f9413b0c7134465c48f41ba24410b2885.zip |
trade: you can not change trade quantities (RO protocol forbids it...)
Diffstat (limited to 'src/gui/trade.cpp')
-rw-r--r-- | src/gui/trade.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp index bcc5f8ce..ff68c402 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -255,12 +255,18 @@ void TradeWindow::action(const std::string &eventId) if (inventoryWindow->items->getIndex() >= 0 && inventoryWindow->items->getIndex() <= INVENTORY_SIZE) { if (tradeWindow->myItems->getFreeSlot() >= 0) { - if (inventoryWindow->items->getQuantity() == 1) { - tradeItem(inventoryWindow->items->getIndex(), 1); - } - else { - // Choose amount of items to trade - new ItemAmountWindow(AMOUNT_TRADE_ADD, this); + if (tradeWindow->myItems->getIndex( + inventoryWindow->items->getId()) == -1) { + if (inventoryWindow->items->getQuantity() == 1) { + tradeItem(inventoryWindow->items->getIndex(), 1); + } + else { + // Choose amount of items to trade + new ItemAmountWindow(AMOUNT_TRADE_ADD, this); + } + } else { + chatWindow->chat_log("Failed adding item. You can not " + "overlap one kind of item on the window.", BY_SERVER); } } } |