summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/trade.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp
index 78d15e3d..ee947e4f 100644
--- a/src/gui/trade.cpp
+++ b/src/gui/trade.cpp
@@ -251,9 +251,14 @@ void TradeWindow::action(const std::string &eventId)
if (inventoryWindow->items->getIndex() >= 0 &&
inventoryWindow->items->getIndex() <= INVENTORY_SIZE) {
if (tradeWindow->myItems->getFreeSlot() >= 0) {
- itemAmountWindow->setUsage(AMOUNT_TRADE_ADD);
- itemAmountWindow->setVisible(true);
- itemAmountWindow->requestMoveToTop();
+ if (inventoryWindow->items->getQuantity() == 1) {
+ tradeItem(inventoryWindow->items->getIndex(), 1);
+ }
+ else {
+ itemAmountWindow->setUsage(AMOUNT_TRADE_ADD);
+ itemAmountWindow->setVisible(true);
+ itemAmountWindow->requestMoveToTop();
+ }
}
}
} else if (eventId == "cancel") {