diff options
author | Ira Rice <irarice@gmail.com> | 2008-11-22 01:56:05 +0000 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2008-11-22 01:56:05 +0000 |
commit | 73ccb1a8eacd7cb339eca67d7312107739f03605 (patch) | |
tree | 7c08db85553087b13bb6a7d286c399000a974ee0 /src | |
parent | f5c0ed3ec4216219494121721a4cce0c7ec4fb34 (diff) | |
download | mana-73ccb1a8eacd7cb339eca67d7312107739f03605.tar.gz mana-73ccb1a8eacd7cb339eca67d7312107739f03605.tar.bz2 mana-73ccb1a8eacd7cb339eca67d7312107739f03605.tar.xz mana-73ccb1a8eacd7cb339eca67d7312107739f03605.zip |
While there is still a small visual artifact, this patch fixes the buy
window so that it properly reports how much money you have.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/buy.cpp | 3 | ||||
-rw-r--r-- | src/gui/buy.h | 6 | ||||
-rw-r--r-- | src/net/buysellhandler.cpp | 1 |
3 files changed, 4 insertions, 6 deletions
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp index a4574eb7..597a7cad 100644 --- a/src/gui/buy.cpp +++ b/src/gui/buy.cpp @@ -156,9 +156,6 @@ void BuyDialog::action(const gcn::ActionEvent &event) mSlider->setValue(mAmountItems); updateButtonsAndLabels(); } - // TODO: Actually we'd have a bug elsewhere if this check for the number - // of items to be bought ever fails, Bertram removed the assertions, is - // there a better way to ensure this fails in an _obivous_ way in C++? else if (event.getId() == "buy" && mAmountItems > 0 && mAmountItems <= mMaxItems) { diff --git a/src/gui/buy.h b/src/gui/buy.h index 0915385a..3b94bbaa 100644 --- a/src/gui/buy.h +++ b/src/gui/buy.h @@ -117,9 +117,9 @@ class BuyDialog : public Window, public gcn::ActionListener, ShopItems *mShopItems; - int mMoney; - int mAmountItems; - int mMaxItems; + Uint32 mMoney; + Uint32 mAmountItems; + Uint32 mMaxItems; }; #endif diff --git a/src/net/buysellhandler.cpp b/src/net/buysellhandler.cpp index b464e69f..ad613889 100644 --- a/src/net/buysellhandler.cpp +++ b/src/net/buysellhandler.cpp @@ -113,6 +113,7 @@ void BuySellHandler::handleMessage(MessageIn *msg) if (msg->readInt8() == 0) { chatWindow->chatLog("Thanks for buying", BY_SERVER); } else { + buyDialog->setMoney(player_node->mGp); chatWindow->chatLog("Unable to buy", BY_SERVER); } break; |