From 73ccb1a8eacd7cb339eca67d7312107739f03605 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Sat, 22 Nov 2008 01:56:05 +0000 Subject: While there is still a small visual artifact, this patch fixes the buy window so that it properly reports how much money you have. --- src/gui/buy.cpp | 3 --- src/gui/buy.h | 6 +++--- 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; -- cgit v1.2.3-70-g09d2