From d6f2cdf4da05482df874fedc24832735eb80c8fc Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Thu, 24 Jul 2008 17:04:42 +0000 Subject: Properly update price after buying. --- src/gui/buy.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp index 4dee6813..c12e18b6 100644 --- a/src/gui/buy.cpp +++ b/src/gui/buy.cpp @@ -171,15 +171,15 @@ void BuyDialog::action(const gcn::ActionEvent &event) outMsg.writeInt16(mAmountItems); outMsg.writeInt16(mShopItems->at(selectedItem)->getId()); - // Reset selection - mAmountItems = 1; - mSlider->setValue(1); - mSlider->gcn::Slider::setScale(1, mMaxItems); - // Update money and adjust the max number of items that can be bought mMaxItems -= mAmountItems; setMoney(mMoney - mAmountItems * mShopItems->at(selectedItem)->getPrice()); + + // Reset selection + mAmountItems = 1; + mSlider->setValue(1); + mSlider->gcn::Slider::setScale(1, mMaxItems); } } -- cgit v1.2.3-60-g2f50