From 7058126e99adb55e43f5f487b007d3efa9f324d5 Mon Sep 17 00:00:00 2001
From: Abnormal <86753001+AbnormalPoof@users.noreply.github.com>
Date: Mon, 21 Oct 2024 10:31:54 -0500
Subject: [PATCH] fix: Actually check if the Playable Character is unlocked

---
 source/funkin/ui/charSelect/CharSelectSubState.hx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/source/funkin/ui/charSelect/CharSelectSubState.hx b/source/funkin/ui/charSelect/CharSelectSubState.hx
index 4eb975e8a..bb3e06c23 100644
--- a/source/funkin/ui/charSelect/CharSelectSubState.hx
+++ b/source/funkin/ui/charSelect/CharSelectSubState.hx
@@ -474,7 +474,10 @@ class CharSelectSubState extends MusicBeatSubState
       }
       else
       {
-        if (availableChars.exists(i)) nonLocks.push(i);
+        var playableCharacterId:String = availableChars.get(i);
+        var player:Null<PlayableCharacter> = PlayerRegistry.instance.fetchEntry(playableCharacterId);
+        var isPlayerUnlocked:Bool = player?.isUnlocked() ?? false;
+        if (availableChars.exists(i) && isPlayerUnlocked) nonLocks.push(i);
 
         var temp:Lock = new Lock(0, 0, i);
         temp.ID = 1;