summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2008-07-24 17:04:42 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2008-07-24 17:04:42 +0000
commitd6f2cdf4da05482df874fedc24832735eb80c8fc (patch)
treec82b92573408d1df5ec45abc39ca070ba207ee37
parent19ee623c0a1fdd333ef5b945ea887c983c829b1e (diff)
downloadmana-d6f2cdf4da05482df874fedc24832735eb80c8fc.tar.gz
mana-d6f2cdf4da05482df874fedc24832735eb80c8fc.tar.bz2
mana-d6f2cdf4da05482df874fedc24832735eb80c8fc.tar.xz
mana-d6f2cdf4da05482df874fedc24832735eb80c8fc.zip
Properly update price after buying.
-rw-r--r--ChangeLog1
-rw-r--r--src/gui/buy.cpp10
2 files changed, 6 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 612624a0..d5fd476a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
2008-07-24 Eugenio Favalli <elvenprogrammer@themanaworld.org>
* src/game.cpp: Fixed visibility of buy and sell dialogs.
+ * src/gui/buy.cpp: Properly update price after buying.
2008-07-23 Eugenio Favalli <elvenprogrammer@themanaworld.org>
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);
}
}