Skip to content

Commit

Permalink
Fix hit circle judgement potentially being behind by an update tick
Browse files Browse the repository at this point in the history
  • Loading branch information
Rian8337 committed Nov 14, 2024
1 parent f52f7c1 commit 29b03ef
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/ru/nsu/ccfit/zuev/osu/game/GameplayHitCircle.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,9 @@ public void update(final float dt) {
} else {
float frameHitOffset = (float) hitOffsetToPreviousFrame() / 1000;

if (canBeHit(dt, frameHitOffset) && isHit()) {
// At this point, the object's state is already in the next update tick.
// However, hit judgements require the object's state to be in the previous tick.
// Therefore, we subtract dt to get the object's state in the previous tick.
float signAcc = passedTime - timePreempt - dt + frameHitOffset;
// dt is 0 here as the current time is updated *after* this judgement.
if (canBeHit(0, frameHitOffset) && isHit()) {
float signAcc = passedTime - timePreempt + frameHitOffset;
final float acc = Math.abs(signAcc);
if (acc <= GameHelper.getDifficultyHelper().hitWindowFor50(GameHelper.getOverallDifficulty())) {
playHitSamples();
Expand Down

0 comments on commit 29b03ef

Please sign in to comment.