Skip to content

Commit

Permalink
Fix Chart Preview music not setting when initializing and switching song
Browse files Browse the repository at this point in the history
only for first initialization (race conditions !!!!!!! xDDD)
  • Loading branch information
poco0317 committed Dec 8, 2019
1 parent f241ee3 commit 8b683c5
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ local function toggleNoteField()
if usingreverse then
mcbootlarder:GetChild("NoteField"):y(prevY * 1.5 + prevrevY)
end
playMusicForPreview(song)
if not songChanged then
playMusicForPreview(song)
tryingToStart = true
else
tryingToStart = false
end
songChanged = false
hackysack = false
previewVisible = true
Expand Down Expand Up @@ -155,7 +160,7 @@ local t =
-- also applies for if we just toggled the notefield or changed screen tabs
shouldPlayMusic = shouldPlayMusic or hackysack
-- should play the music if we already should and we either jumped song or we didnt change the style/song
shouldPlayMusic = shouldPlayMusic and ((not justChangedStyles and not onlyChangedSteps) or unexpectedlyChangedSong)
shouldPlayMusic = shouldPlayMusic and ((not justChangedStyles and not onlyChangedSteps) or unexpectedlyChangedSong) and not tryingToStart

if s and shouldPlayMusic then
mcbootlarder:GetChild("NoteField"):diffusealpha(1)
Expand Down

0 comments on commit 8b683c5

Please sign in to comment.