Skip to content

Commit 6a25c58

Browse files
committed
Fix Not checking misses correctly after loops
For when I go back and look at this commit: The issue is we say songs can be longer than an exact int num of loops. So a song can eventually have a realbeat > beatsperloop. The current logic is a bit blind, and: (if the realbeat is ahead of last beat) -> increment last beat to catch up. But last beat is mod beatsperloop, so it tries to catch up while realbeat is a float beyond beatsperloop, so it keeps overrunning until we fully loop and realbeat is back to approximately 0. This fix just continues if realbeat is beyond beatsperloop. This does not fix the underlying issue that lastbeat can absolutely be desynced from the actual beat, because I'm already up too late.
1 parent 3542020 commit 6a25c58

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

scenes/BattleDirector/scripts/Conductor.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,11 @@ public void CheckMiss(double realBeat)
100100
for (int i = 0; i < _laneData.Length; i++)
101101
{
102102
if (
103-
!(_laneLastBeat[i] < Math.Floor(realBeat))
104-
&& (_laneLastBeat[i] != CM.BeatsPerLoop - 1 || Math.Floor(realBeat) != 0)
103+
realBeat > CM.BeatsPerLoop
104+
|| (
105+
_laneLastBeat[i] >= Math.Floor(realBeat)
106+
&& (_laneLastBeat[i] < CM.BeatsPerLoop - 1 || Math.Floor(realBeat) != 0)
107+
)
105108
)
106109
continue;
107110
if (_laneData[i][_laneLastBeat[i]] == null || !_laneData[i][_laneLastBeat[i]].IsActive)

0 commit comments

Comments
 (0)