Skip to content

Commit 3ad14ba

Browse files
NotHyper-474ninjamuffin99
authored andcommitted
fix: Double check if events are the same when doing indexOf
This is basically copy-pasted from SongNoteDataArrayTools lol
1 parent e672c09 commit 3ad14ba

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

source/funkin/util/tools/SongEventDataArrayTools.hx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,16 @@ class SongEventDataArrayTools
4646
// Search the lower half of the range.
4747
highIndex = midIndex - 1;
4848
}
49-
else
49+
// Found it? Make a more thorough check.
50+
else if (midNote == note)
5051
{
51-
// Found it!
5252
return midIndex;
5353
}
54+
else
55+
{
56+
// We may be close, so constrain the range (but only a little) and try again.
57+
highIndex -= 1;
58+
}
5459
}
5560
return -1;
5661
}

0 commit comments

Comments
 (0)