Added a listener for the end of music tracks.

Fixes a bug during gameplay where if the music track ends before the last hit object is processed (esp. spinners), the game would hang.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-01-29 21:24:21 -05:00
parent e93fe25834
commit 84e463e8fb
3 changed files with 29 additions and 9 deletions

View File

@@ -152,11 +152,9 @@ public class Spinner implements HitObject {
@Override
public boolean update(boolean overlap, int delta, int mouseX, int mouseY) {
int trackPosition = MusicController.getPosition();
if (overlap)
return true;
// end of spinner
if (trackPosition > hitObject.getEndTime()) {
if (overlap || trackPosition > hitObject.getEndTime()) {
hitResult();
return true;
}