From a76b05dce902f4a2386840b0f3fef9968cd2cbfb Mon Sep 17 00:00:00 2001 From: JordanSantiagoYT Date: Sat, 19 Oct 2024 16:22:32 -0400 Subject: [PATCH] attempt a bpmtxt crash fix closes #670 (hopefully) --- source/editors/ChartingState.hx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/source/editors/ChartingState.hx b/source/editors/ChartingState.hx index 6e26833d8dc..f3816bd1e91 100644 --- a/source/editors/ChartingState.hx +++ b/source/editors/ChartingState.hx @@ -3039,15 +3039,19 @@ class ChartingState extends MusicBeatState opponentVocals.pitch = playbackSpeed; #end - if (bpmTxt != null) bpmTxt.text = - CoolUtil.formatTime(Conductor.songPosition, 2) + ' / ' + CoolUtil.formatTime(FlxG.sound.music.length, 2) + - "\nSection: " + curSec + - "\n\nBeat: " + Std.string(curDecBeat).substring(0,4) + - "\nStep: " + curStep + - "\nBeat Snap: " + quantization + "th" + - "\n\n" + FlxStringUtil.formatMoney(CoolUtil.getNoteAmount(_song), false) + ' Notes' + - "\n\nRendered Notes: " + FlxStringUtil.formatMoney(Math.abs(curRenderedNotes.length + nextRenderedNotes.length), false) + - "\n\nSection Notes: " + FlxStringUtil.formatMoney(_song.notes[curSec].sectionNotes.length, false); + if (bpmTxt != null) + { + bpmTxt.text = + CoolUtil.formatTime(Conductor.songPosition, 2) + ' / ' + CoolUtil.formatTime(FlxG.sound.music.length, 2) + + "\nSection: " + curSec + + "\n\nBeat: " + Std.string(curDecBeat).substring(0,4) + + "\nStep: " + curStep + + "\nBeat Snap: " + quantization + "th" + + "\n\n" + FlxStringUtil.formatMoney(CoolUtil.getNoteAmount(_song), false) + ' Notes' + + "\n\nRendered Notes: " + FlxStringUtil.formatMoney(Math.abs(curRenderedNotes.length + nextRenderedNotes.length), false); + + if (_song.notes[curSec] != null) bpmTxt.text += "\n\nSection Notes: " + FlxStringUtil.formatMoney(_song.notes[curSec].sectionNotes.length, false); + } var playedSound:Array = [false, false, false, false]; //Prevents ouchy GF sex sounds curRenderedNotes.forEachAlive(function(note:Note) {