Skip to content

Commit

Permalink
Setlist bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
EscapeNumber001 committed Apr 19, 2023
1 parent fca3728 commit 96cf745
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Assets/Script/PlayMode/Play.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,11 @@ public static void AddSongToSetlist(SongInfo song, float speed)

public static void StartSetlist()
{
song = setlist[0];
// Song index gets incremented to 0 by ContinueSetlist().
setlistCurrentSongIndex = -1;

setlistSize = setlist.Count;
setlistCurrentSongIndex = 0;
GameManager.Instance.LoadScene(SceneIndex.PLAY);
ContinueSetlist();
}

public static void ContinueSetlist()
Expand All @@ -347,7 +348,6 @@ public static void ContinueSetlist()

public static void EndSetlist()
{
Debug.Log("Setlist finished");
setlistSize = 0;
setlistCurrentSongIndex = 0;
setlist.Clear();
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/UI/PostSong.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private void OnDisable() {
player.inputStrategy.GenericNavigationEvent -= OnGenericNavigation;
}

if (Play.setlistCurrentSongIndex < Play.setlistSize)
if (Play.setlistCurrentSongIndex < Play.setlistSize - 1)
{
Play.ContinueSetlist();
} else
Expand Down

0 comments on commit 96cf745

Please sign in to comment.