@@ -515,6 +515,11 @@ class FreeplayState extends MusicBeatState
515515 var locationIds : Null <Array <Int >> = APEntryState .apGame .locationData (songNameThing ).concat (APEntryState .apGame .noteData (songNameThing , modName ));
516516 var isMissing : Bool = APEntryState .apGame .areLocationsMissing (locationIds );
517517
518+ if (locationIds .isEmpty ())
519+ {
520+ continue ;
521+ }
522+
518523 for (songName in curUnlocked .keys ())
519524 {
520525 if (((songNameThing .trim ().toLowerCase ().replace (' -' , ' ' ) == songName .trim ().toLowerCase ().replace (' -' , ' ' )) && leWeek .folder == curUnlocked .get (songName )) && isMissing )
@@ -527,6 +532,11 @@ class FreeplayState extends MusicBeatState
527532 var modName : String = leWeek .folder ;
528533 var locationIds : Null <Array <Int >> = APEntryState .apGame .locationData (songNameThing ).concat (APEntryState .apGame .noteData (songNameThing , modName ));
529534 var isMissing : Bool = APEntryState .apGame .areLocationsMissing (locationIds );
535+
536+ if (locationIds .isEmpty ())
537+ {
538+ continue ;
539+ }
530540 for (songName in curUnlocked .keys ())
531541 {
532542 if (((songNameThing .trim ().toLowerCase ().replace (' -' , ' ' ) == songName .trim ().toLowerCase ().replace (' -' , ' ' )) && leWeek .folder == curUnlocked .get (songName )) && ! isMissing )
@@ -539,6 +549,11 @@ class FreeplayState extends MusicBeatState
539549 var modName : String = leWeek .folder ;
540550 var locationIds : Null <Array <Int >> = APEntryState .apGame .locationData (songNameThing ).concat (APEntryState .apGame .noteData (songNameThing , modName ));
541551 var isMissing : Bool = APEntryState .apGame .areLocationsMissing (locationIds );
552+
553+ if (locationIds .isEmpty ())
554+ {
555+ continue ;
556+ }
542557 for (songName in curHinted .keys ())
543558 {
544559 if (((songNameThing .trim ().toLowerCase ().replace (' -' , ' ' ) == songName .trim ().toLowerCase ().replace (' -' , ' ' )) && leWeek .folder == curHinted .get (songName )) && isMissing )
@@ -553,6 +568,11 @@ class FreeplayState extends MusicBeatState
553568 var songNameThing : String = song [0 ];
554569 var modName : String = leWeek .folder ;
555570 var locationIds : Null <Array <Int >> = APEntryState .apGame .locationData (songNameThing ).concat (APEntryState .apGame .noteData (songNameThing , modName ));
571+
572+ if (locationIds .isEmpty ())
573+ {
574+ continue ;
575+ }
556576 if (locationIds != null && locationIds .isNotEmpty ())
557577 addSong (song [0 ], i , song [1 ], FlxColor .fromRGB (colors [0 ], colors [1 ], colors [2 ]));
558578 }
@@ -860,6 +880,15 @@ class FreeplayState extends MusicBeatState
860880 instance .reloadSongs (true );
861881 }
862882 trace (" forceUnlockCheck completed." );
883+
884+ trace (" Checking if the song is a victory song..." );
885+
886+ if (archipelago. APEntryState .apGame .checkGoal (songName , modName )) {
887+ archipelago. ArchPopup .startPopupCustom (" Congratulations! You've achieved your goal!" , " Well Done!" , " archColor" , function () {
888+ trace (" Goal achievement popup triggered." );
889+ FlxG .sound .playMusic (Paths .sound (' victory' ));
890+ });
891+ }
863892 }
864893
865894
0 commit comments