Skip to content

Commit

Permalink
Fix gameplay restart in HUD editor mode potentially skipping too far …
Browse files Browse the repository at this point in the history
…ahead
  • Loading branch information
Rian8337 committed Mar 1, 2025
1 parent 78bb447 commit a663907
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ru/nsu/ccfit/zuev/osu/game/GameScene.java
Original file line number Diff line number Diff line change
Expand Up @@ -1635,9 +1635,12 @@ public void skip(boolean force)
}

ResourceManager.getInstance().getSound("menuhit").play();
float difference = skipTime - elapsedTime;

elapsedTime = skipTime;
float difference = Math.max(0, skipTime - elapsedTime);

// Skip time may be negative in forced skips, which will cause desynchronization between game time and
// audio time, so we cap it at 0.
elapsedTime = Math.max(0, skipTime);
int seekTime = (int) Math.ceil(elapsedTime * 1000);
int videoSeekTime = seekTime - (int) (videoOffset * 1000);

Expand Down

0 comments on commit a663907

Please sign in to comment.