From 056813a5872c1778ed1fe9395ece5a530b4195b2 Mon Sep 17 00:00:00 2001 From: Reco1l Date: Fri, 22 Nov 2024 20:50:52 -0300 Subject: [PATCH] Store scenes references locally --- src/ru/nsu/ccfit/zuev/osu/game/GameScene.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ru/nsu/ccfit/zuev/osu/game/GameScene.java b/src/ru/nsu/ccfit/zuev/osu/game/GameScene.java index df319c860..37be9b87d 100644 --- a/src/ru/nsu/ccfit/zuev/osu/game/GameScene.java +++ b/src/ru/nsu/ccfit/zuev/osu/game/GameScene.java @@ -2263,8 +2263,12 @@ public void gameover() { float initialFrequency = songService.getFrequency(); - // Wind down animation for failing based on osu!stable behavior. + // Locally saving the scenes references to avoid unexpected behavior when the scene is changed. + ExtendedScene scene = this.scene; + ExtendedScene mgScene = this.mgScene; + ExtendedScene bgScene = this.bgScene; + // Wind down animation for failing based on osu!stable behavior. engine.registerUpdateHandler(new IUpdateHandler() { private float elapsedTime;