From 0dd22c4e23c6b3861c43605d804a9adfc67d1188 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sat, 22 May 2021 08:45:25 +0200 Subject: [PATCH] Hearts: Fix crash when starting an animation when there already is one This ensures that the preceding animation is stopped first. --- Userland/Games/Hearts/Game.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Games/Hearts/Game.cpp b/Userland/Games/Hearts/Game.cpp index 5298bbb3cf..fde3e02775 100644 --- a/Userland/Games/Hearts/Game.cpp +++ b/Userland/Games/Hearts/Game.cpp @@ -121,6 +121,8 @@ void Game::setup() void Game::start_animation(NonnullRefPtrVector cards, Gfx::IntPoint const& end, Function did_finish_callback, int initial_delay_ms, int steps) { + stop_animation(); + m_animation_end = end; m_animation_current_step = 0; m_animation_steps = steps;