diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-07-27 22:30:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-07-27 22:30:26 +0300 |
commit | 679ab7c8151b70bc9659c3ef4f16350702560a07 (patch) | |
tree | c4b0a62d7b5b4e1c971d74c3c6a988a161fcee9e | |
parent | c5bd488ce7a9b515cb5ea5008e9438cae65745f4 (diff) | |
download | manaplus-679ab7c8151b70bc9659c3ef4f16350702560a07.tar.gz manaplus-679ab7c8151b70bc9659c3ef4f16350702560a07.tar.bz2 manaplus-679ab7c8151b70bc9659c3ef4f16350702560a07.tar.xz manaplus-679ab7c8151b70bc9659c3ef4f16350702560a07.zip |
Dont allow buy items with amount 0 from markets.
-rw-r--r-- | src/gui/windows/buydialog.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index a6a369e28..cc4cf4699 100644 --- a/src/gui/windows/buydialog.cpp +++ b/src/gui/windows/buydialog.cpp @@ -734,8 +734,16 @@ void BuyDialog::updateButtonsAndLabels() else mMaxItems = 1; - if (item->getQuantity() > 0 && mMaxItems > item->getQuantity()) + if (mNpcId == fromInt(Market, BeingId)) + { + if (mMaxItems > item->getQuantity()) + mMaxItems = item->getQuantity(); + } + else if (item->getQuantity() > 0 && + mMaxItems > item->getQuantity()) + { mMaxItems = item->getQuantity(); + } if (mAmountItems > mMaxItems) mAmountItems = mMaxItems; |