From 75e8061f9413b0c7134465c48f41ba24410b2885 Mon Sep 17 00:00:00 2001 From: Jan-Fabian Humann Date: Sat, 21 May 2005 14:17:58 +0000 Subject: trade: you can not change trade quantities (RO protocol forbids it...) --- src/gui/trade.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src') 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); } } } -- cgit v1.2.3-60-g2f50