mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +00:00
Solitaire: Only update high score after a victorious game
Doesn't make much sense to update the high score on a lost game.
This commit is contained in:
parent
95401d2ca2
commit
0b30a0febb
3 changed files with 14 additions and 9 deletions
|
@ -80,7 +80,7 @@ void Game::start_game_over_animation()
|
|||
start_timer(s_timer_interval_ms);
|
||||
|
||||
if (on_game_end)
|
||||
on_game_end();
|
||||
on_game_end(GameOverReason::Victory, m_score);
|
||||
}
|
||||
|
||||
void Game::stop_game_over_animation()
|
||||
|
@ -103,7 +103,7 @@ void Game::setup(Mode mode)
|
|||
m_mode = mode;
|
||||
|
||||
if (on_game_end)
|
||||
on_game_end();
|
||||
on_game_end(GameOverReason::NewGame, m_score);
|
||||
|
||||
for (auto& stack : m_stacks)
|
||||
stack.clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue