mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +00:00
Hearts: Fix crash when starting an animation when there already is one
This ensures that the preceding animation is stopped first.
This commit is contained in:
parent
630430379e
commit
0dd22c4e23
1 changed files with 2 additions and 0 deletions
|
@ -121,6 +121,8 @@ void Game::setup()
|
||||||
|
|
||||||
void Game::start_animation(NonnullRefPtrVector<Card> cards, Gfx::IntPoint const& end, Function<void()> did_finish_callback, int initial_delay_ms, int steps)
|
void Game::start_animation(NonnullRefPtrVector<Card> cards, Gfx::IntPoint const& end, Function<void()> did_finish_callback, int initial_delay_ms, int steps)
|
||||||
{
|
{
|
||||||
|
stop_animation();
|
||||||
|
|
||||||
m_animation_end = end;
|
m_animation_end = end;
|
||||||
m_animation_current_step = 0;
|
m_animation_current_step = 0;
|
||||||
m_animation_steps = steps;
|
m_animation_steps = steps;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue