From a7429406570ebb898bf8b22f58e37cac001574f1 Mon Sep 17 00:00:00 2001
From: Cameron Taylor <cameron.taylor.ninja@gmail.com>
Date: Fri, 4 Dec 2020 12:36:28 -0500
Subject: [PATCH] exploit fixin

---
 CHANGELOG.md            | 1 +
 source/FreeplayState.hx | 7 +------
 source/PlayState.hx     | 8 ++++++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 01ef98d33..1333baa75 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [UNRELEASED]
 ### Fixed
+- Exploit where you could potentially give yourself a high score via the debug menu
 - Issue/bug where you could spam the confirm button on the story menu ([shoutouts lotusotho for the CODE contribution/pull request!](https://github.com/ninjamuffin99/Funkin/pull/19))
 - Glitch where if you never would lose health if you missed a note on a fast song (shoutouts [MrDulfin](https://github.com/ninjamuffin99/Funkin/issues/10), [HotSauceBurritos](https://github.com/ninjamuffin99/Funkin/issues/13) and [LobsterMango](https://lobstermango.newgrounds.com))
 - Fixed tiny note bleed over thingies (shoutouts [lotusotho](https://github.com/ninjamuffin99/Funkin/pull/24))
diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx
index ccfdefaf2..795091ffa 100644
--- a/source/FreeplayState.hx
+++ b/source/FreeplayState.hx
@@ -42,7 +42,7 @@ class FreeplayState extends MusicBeatState
 		isDebug = true;
 		#end
 
-		if (StoryMenuState.weekUnlocked[1] || isDebug)
+		if (StoryMenuState.weekUnlocked[2] || isDebug)
 		{
 			songs.push('Spookeez');
 			songs.push('South');
@@ -180,12 +180,10 @@ class FreeplayState extends MusicBeatState
 		if (curDifficulty > 2)
 			curDifficulty = 0;
 
-
 		#if !switch
 		intendedScore = Highscore.getScore(songs[curSelected], curDifficulty);
 		#end
 
-
 		switch (curDifficulty)
 		{
 			case 0:
@@ -199,7 +197,6 @@ class FreeplayState extends MusicBeatState
 
 	function changeSelection(change:Int = 0)
 	{
-
 		#if !switch
 		NGio.logEvent('Fresh');
 		#end
@@ -216,13 +213,11 @@ class FreeplayState extends MusicBeatState
 
 		// selector.y = (70 * curSelected) + 30;
 
-
 		#if !switch
 		intendedScore = Highscore.getScore(songs[curSelected], curDifficulty);
 		// lerpScore = 0;
 		#end
 
-
 		FlxG.sound.playMusic('assets/music/' + songs[curSelected] + "_Inst" + TitleState.soundExt, 0);
 
 		var bullShit:Int = 0;
diff --git a/source/PlayState.hx b/source/PlayState.hx
index 7bad61d0a..2c5c6da81 100644
--- a/source/PlayState.hx
+++ b/source/PlayState.hx
@@ -872,10 +872,14 @@ class PlayState extends MusicBeatState
 
 				FlxG.switchState(new StoryMenuState());
 
+				// if ()
 				StoryMenuState.weekUnlocked[2] = true;
 
-				NGio.unlockMedal(60961);
-				Highscore.saveWeekScore(storyWeek, campaignScore, storyDifficulty);
+				if (SONG.validScore)
+				{
+					NGio.unlockMedal(60961);
+					Highscore.saveWeekScore(storyWeek, campaignScore, storyDifficulty);
+				}
 
 				FlxG.save.data.weekUnlocked = StoryMenuState.weekUnlocked;
 				FlxG.save.flush();