From 3a13105d61703f01535bbcda6690612de797ad9d Mon Sep 17 00:00:00 2001 From: RandomityGuy <31925790+RandomityGuy@users.noreply.github.com> Date: Sun, 4 Jun 2023 22:23:01 +0530 Subject: [PATCH] actually fix those bugs- --- src/MarbleWorld.hx | 4 ++++ src/rewind/RewindFrame.hx | 3 ++- src/rewind/RewindManager.hx | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/MarbleWorld.hx b/src/MarbleWorld.hx index 337ff874..289edf6e 100644 --- a/src/MarbleWorld.hx +++ b/src/MarbleWorld.hx @@ -470,12 +470,15 @@ class MarbleWorld extends Scheduler { return; // We will update state manually if (this.timeState.currentAttemptTime < 0.5) { this.playGui.setCenterText('none'); + this.marble.mode = Start; } if ((this.timeState.currentAttemptTime >= 0.5) && (this.timeState.currentAttemptTime < 2)) { this.playGui.setCenterText('ready'); + this.marble.mode = Start; } if ((this.timeState.currentAttemptTime >= 2) && (this.timeState.currentAttemptTime < 3.5)) { this.playGui.setCenterText('set'); + this.marble.mode = Start; } if ((this.timeState.currentAttemptTime >= 3.5) && (this.timeState.currentAttemptTime < 5.5)) { this.playGui.setCenterText('go'); @@ -483,6 +486,7 @@ class MarbleWorld extends Scheduler { } if (this.timeState.currentAttemptTime >= 5.5) { this.playGui.setCenterText('none'); + this.marble.mode = Play; } } diff --git a/src/rewind/RewindFrame.hx b/src/rewind/RewindFrame.hx index 330cd812..0bca0f05 100644 --- a/src/rewind/RewindFrame.hx +++ b/src/rewind/RewindFrame.hx @@ -74,7 +74,8 @@ class RewindFrame { } c.oobState = { oob: oobState.oob, - timeState: oobState.timeState.clone() + timeState: oobState.timeState != null ? oobState.timeState.clone() : null }; + return c; } } diff --git a/src/rewind/RewindManager.hx b/src/rewind/RewindManager.hx index 1ddae2c7..761ce091 100644 --- a/src/rewind/RewindManager.hx +++ b/src/rewind/RewindManager.hx @@ -184,6 +184,9 @@ class RewindManager { var topFrame = frames[frames.length - 1]; while (topFrame.timeState.currentAttemptTime > absTime) { + if (frames.length == 1) { + return frames[0]; + } frames.pop(); if (frames.length == 0) return null;