From f90f39b8dd3b5e1a454aa20d40c24265c501c1ef Mon Sep 17 00:00:00 2001 From: Hugo Pezziardi Date: Thu, 14 Dec 2023 12:47:22 +0100 Subject: [PATCH] :bug: (GEK): Fix DanceFreeze ending bug --- .../Specialized/DanceFreeze/DanceFreeze+PlayerView.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/GameEngineKit/Sources/_NewSystem/Exercises/Specialized/DanceFreeze/DanceFreeze+PlayerView.swift b/Modules/GameEngineKit/Sources/_NewSystem/Exercises/Specialized/DanceFreeze/DanceFreeze+PlayerView.swift index e14361575f..27bba6dcbb 100644 --- a/Modules/GameEngineKit/Sources/_NewSystem/Exercises/Specialized/DanceFreeze/DanceFreeze+PlayerView.swift +++ b/Modules/GameEngineKit/Sources/_NewSystem/Exercises/Specialized/DanceFreeze/DanceFreeze+PlayerView.swift @@ -51,10 +51,12 @@ extension DanceFreeze { } func randomSwitch() { + guard self.viewModel.exercicesSharedData.state != .completed else { return } if self.viewModel.progress < 1.0, self.viewModel.exercicesSharedData.state != .completed { let rand = Double.random(in: 2..<10) DispatchQueue.main.asyncAfter(deadline: .now() + rand) { + guard self.viewModel.exercicesSharedData.state != .completed else { return } self.viewModel.onDanceFreezeToggle() self.randomSwitch() }