From f7ff381bc7d526977d55a61f059fc60de747ef4a Mon Sep 17 00:00:00 2001
From: EliteMasterEric <ericmyllyoja@gmail.com>
Date: Tue, 2 Apr 2024 23:33:10 -0400
Subject: [PATCH] Fix some build issues with HTML5.

---
 source/funkin/ui/debug/latency/LatencyState.hx | 5 +----
 source/funkin/ui/transition/LoadingState.hx    | 4 ++--
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/source/funkin/ui/debug/latency/LatencyState.hx b/source/funkin/ui/debug/latency/LatencyState.hx
index 7b2eabb1c..875a956e0 100644
--- a/source/funkin/ui/debug/latency/LatencyState.hx
+++ b/source/funkin/ui/debug/latency/LatencyState.hx
@@ -171,10 +171,7 @@ class LatencyState extends MusicBeatSubState
       trace(FlxG.sound.music._channel.position);
      */
 
-    #if FLX_DEBUG
-    funnyStatsGraph.update(FlxG.sound.music.time % 500);
-    realStats.update(swagSong.getTimeWithDiff() % 500);
-    #end
+    localConductor.update(swagSong.time, false);
 
     if (FlxG.keys.justPressed.S)
     {
diff --git a/source/funkin/ui/transition/LoadingState.hx b/source/funkin/ui/transition/LoadingState.hx
index e4f4bf004..af8798ae2 100644
--- a/source/funkin/ui/transition/LoadingState.hx
+++ b/source/funkin/ui/transition/LoadingState.hx
@@ -222,7 +222,7 @@ class LoadingState extends MusicBeatSubState
 
     #if NO_PRELOAD_ALL
     // Switch to loading state while we load assets (default on HTML5 target).
-    var loadStateCtor:NextState = function() {
+    var loadStateCtor = function() {
       var result = new LoadingState(playStateCtor, shouldStopMusic, params);
       @:privateAccess
       result.asSubState = asSubState;
@@ -230,7 +230,7 @@ class LoadingState extends MusicBeatSubState
     }
     if (asSubState)
     {
-      FlxG.state.openSubState(loadStateCtor);
+      FlxG.state.openSubState(cast loadStateCtor());
     }
     else
     {