aboutsummaryrefslogtreecommitdiff
path: root/game/menus/shop/ButtonBuySelectBubbleScript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'game/menus/shop/ButtonBuySelectBubbleScript.cpp')
-rw-r--r--game/menus/shop/ButtonBuySelectBubbleScript.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/game/menus/shop/ButtonBuySelectBubbleScript.cpp b/game/menus/shop/ButtonBuySelectBubbleScript.cpp
index 21dbe1a..741afde 100644
--- a/game/menus/shop/ButtonBuySelectBubbleScript.cpp
+++ b/game/menus/shop/ButtonBuySelectBubbleScript.cpp
@@ -17,19 +17,17 @@ void ButtonBuySelectBubbleScript::init() {
bool ButtonBuySelectBubbleScript::on_button_press(const ButtonPressEvent & e) {
SaveManager & save = this->get_save_manager();
- ValueBroker<int> buy_bullet = save.get<int>(BUY_BUBBLE_SAVE,0);
- if(!buy_bullet.get()){
- ValueBroker<int> coins = save.get<int>(TOTAL_COINS_GAME,0);
- if(coins.get() >= 1000)
- {
+ ValueBroker<int> buy_bullet = save.get<int>(BUY_BUBBLE_SAVE, 0);
+ if (!buy_bullet.get()) {
+ ValueBroker<int> coins = save.get<int>(TOTAL_COINS_GAME, 0);
+ if (coins.get() >= 1000) {
int coin = coins.get();
coin -= 1000;
- save.set(TOTAL_COINS_GAME,coin);
- save.set(BUY_BUBBLE_SAVE,1);
+ save.set(TOTAL_COINS_GAME, coin);
+ save.set(BUY_BUBBLE_SAVE, 1);
}
- }
- else {
- save.set(JETPACK_PARTICLES,1);
+ } else {
+ save.set(JETPACK_PARTICLES, 1);
}
this->trigger_event<ShopUpdate>();
return false;