Skip to content

Commit

Permalink
[BUGFIX] Fix for strange ChartingState hitsounds offset, i hope
Browse files Browse the repository at this point in the history
  • Loading branch information
PurSnake authored Aug 1, 2024
1 parent 9b483de commit ddf3fb5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions source/funkin/ui/debug/charting/ChartEditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
*/
public static final WELCOME_MUSIC_FADE_IN_DURATION:Float = 10.0;

/**
* Hitsounds are played with a strange offset and this should not happen.
*/
public static final HITSOUND_OFFSET:Float = -13;

/**
* INSTANCE DATA
*/
Expand Down Expand Up @@ -6290,10 +6295,10 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
{
// Check for notes between the old and new song positions.

if (noteData.time < oldSongPosition) // Note is in the past.
if (noteData.time < (oldSongPosition - HITSOUND_OFFSET)) // Note is in the past.
continue;

if (noteData.time > newSongPosition) // Note is in the future.
if (noteData.time > (newSongPosition - HITSOUND_OFFSET)) // Note is in the future.
return; // Assume all notes are also in the future.

// Note was just hit.
Expand Down

0 comments on commit ddf3fb5

Please sign in to comment.