diff options
author | heavydemon21 <48092678+heavydemon21@users.noreply.github.com> | 2025-01-10 14:44:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-10 14:44:59 +0100 |
commit | 798237b661e8e49284e78ffb1a16599cf6a46a6d (patch) | |
tree | 8f4881cf4abc58774625383620cf82fa55b9d1f0 /game/menus/shop/ButtonBuySelectBulletScript.cpp | |
parent | bb2db93bfb8dd7e080d2708548eae660e6b33913 (diff) | |
parent | d1cebcca2018ed4ef47ad125e45aafd018a2ab2e (diff) |
Merge pull request #125 from lonkaars/niels/game
missile alerts
Diffstat (limited to 'game/menus/shop/ButtonBuySelectBulletScript.cpp')
-rw-r--r-- | game/menus/shop/ButtonBuySelectBulletScript.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/game/menus/shop/ButtonBuySelectBulletScript.cpp b/game/menus/shop/ButtonBuySelectBulletScript.cpp index 71d8b76..d30849c 100644 --- a/game/menus/shop/ButtonBuySelectBulletScript.cpp +++ b/game/menus/shop/ButtonBuySelectBulletScript.cpp @@ -17,19 +17,17 @@ void ButtonBuySelectBulletScript::init() { bool ButtonBuySelectBulletScript::on_button_press(const ButtonPressEvent & e) { SaveManager & save = this->get_save_manager(); - ValueBroker<int> buy_bullet = save.get<int>(BUY_BULLET_SAVE,0); - if(!buy_bullet.get()){ - ValueBroker<int> coins = save.get<int>(TOTAL_COINS_GAME,0); - if(coins.get() >= 0) - { + ValueBroker<int> buy_bullet = save.get<int>(BUY_BULLET_SAVE, 0); + if (!buy_bullet.get()) { + ValueBroker<int> coins = save.get<int>(TOTAL_COINS_GAME, 0); + if (coins.get() >= 0) { int coin = coins.get(); coin -= 0; - save.set(TOTAL_COINS_GAME,coin); - save.set(BUY_BULLET_SAVE,1); + save.set(TOTAL_COINS_GAME, coin); + save.set(BUY_BULLET_SAVE, 1); } - } - else { - save.set(JETPACK_PARTICLES,0); + } else { + save.set(JETPACK_PARTICLES, 0); } this->trigger_event<ShopUpdate>(); return false; |