summaryrefslogtreecommitdiff
path: root/src/gui/trade.cpp
diff options
context:
space:
mode:
authorJan-Fabian Humann <malastare@gmx.net>2005-05-17 14:35:08 +0000
committerJan-Fabian Humann <malastare@gmx.net>2005-05-17 14:35:08 +0000
commitf77edf341b3d14e07c5f2e996c41f4a2fe7c5171 (patch)
treec3775886cb4d552a3f64f1ebb4443b142ef01829 /src/gui/trade.cpp
parent3fc2cd109a51e6a38783eb5438098d9a962bc655 (diff)
downloadmana-client-f77edf341b3d14e07c5f2e996c41f4a2fe7c5171.tar.gz
mana-client-f77edf341b3d14e07c5f2e996c41f4a2fe7c5171.tar.bz2
mana-client-f77edf341b3d14e07c5f2e996c41f4a2fe7c5171.tar.xz
mana-client-f77edf341b3d14e07c5f2e996c41f4a2fe7c5171.zip
we dont need an itemamount window if quantity in inventory is 1
Diffstat (limited to 'src/gui/trade.cpp')
-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") {