diff --git a/Project.xml b/Project.xml index 78c1b3664..322b46532 100644 --- a/Project.xml +++ b/Project.xml @@ -10,6 +10,7 @@ + diff --git a/source/ChartingState.hx b/source/ChartingState.hx index f83eae315..1ee5f7869 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -97,7 +97,8 @@ class ChartingState extends MusicBeatState player1: 'bf', player2: 'dad', sectionLengths: [], - speed: 1 + speed: 1, + validScore: false; }; } diff --git a/source/PlayState.hx b/source/PlayState.hx index 05dfa83fd..7bad61d0a 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -853,9 +853,12 @@ class PlayState extends MusicBeatState { canPause = false; - #if !switch - Highscore.saveScore(SONG.song, songScore, storyDifficulty); - #end + if (SONG.validScore) + { + #if !switch + Highscore.saveScore(SONG.song, songScore, storyDifficulty); + #end + } if (isStoryMode) { diff --git a/source/Song.hx b/source/Song.hx index 8af708367..772652b94 100644 --- a/source/Song.hx +++ b/source/Song.hx @@ -19,6 +19,7 @@ typedef SwagSong = var player1:String; var player2:String; + var validScore:Bool; } class Song @@ -49,7 +50,6 @@ class Song public static function loadFromJson(jsonInput:String, ?folder:String):SwagSong { - var rawJson = Assets.getText('assets/data/' + folder.toLowerCase() + '/' + jsonInput.toLowerCase() + '.json').trim(); while (!rawJson.endsWith("}")) @@ -59,6 +59,7 @@ class Song } var swagShit:SwagSong = cast Json.parse(rawJson).song; + swagShit.validScore = true; trace(swagShit.notes[0]); // FIX THE CASTING ON WINDOWS/NATIVE