diff options
Diffstat (limited to 'src/gui/windows')
-rw-r--r-- | src/gui/windows/buydialog.cpp | 6 | ||||
-rw-r--r-- | src/gui/windows/setupwindow.cpp | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index fa7297bdd..9dd083d61 100644 --- a/src/gui/windows/buydialog.cpp +++ b/src/gui/windows/buydialog.cpp @@ -617,7 +617,11 @@ void BuyDialog::updateSlider(const int selectedItem) // Update money and adjust the max number of items // that can be bought mMaxItems -= mAmountItems; - setMoney(mMoney - mAmountItems * mShopItems->at(selectedItem)->getPrice()); + const ShopItem *const item = mShopItems->at(selectedItem); + if (item) + setMoney(mMoney - mAmountItems * item->getPrice()); + else + setMoney(mMoney); // Reset selection mAmountItems = 1; diff --git a/src/gui/windows/setupwindow.cpp b/src/gui/windows/setupwindow.cpp index 29f9cf126..19c1e6c52 100644 --- a/src/gui/windows/setupwindow.cpp +++ b/src/gui/windows/setupwindow.cpp @@ -26,6 +26,7 @@ #include "game.h" #include "gui/windows/chatwindow.h" +#include "gui/windows/statuswindow.h" #include "gui/widgets/createwidget.h" @@ -57,7 +58,6 @@ #include "debug.h" -extern Window *statusWindow; SetupWindow *setupWindow = nullptr; SetupWindow::SetupWindow() : |