mirror of
https://github.com/ppy/osu.git
synced 2024-11-12 01:47:24 +08:00
Fix taiko autoplay sometimes missing (#7427)
Fix taiko autoplay sometimes missing
This commit is contained in:
commit
a989f82f13
@ -121,41 +121,13 @@ namespace osu.Game.Rulesets.Taiko.Replays
|
|||||||
var nextHitObject = GetNextObject(i); // Get the next object that requires pressing the same button
|
var nextHitObject = GetNextObject(i); // Get the next object that requires pressing the same button
|
||||||
|
|
||||||
bool canDelayKeyUp = nextHitObject == null || nextHitObject.StartTime > endTime + KEY_UP_DELAY;
|
bool canDelayKeyUp = nextHitObject == null || nextHitObject.StartTime > endTime + KEY_UP_DELAY;
|
||||||
|
|
||||||
double calculatedDelay = canDelayKeyUp ? KEY_UP_DELAY : (nextHitObject.StartTime - endTime) * 0.9;
|
double calculatedDelay = canDelayKeyUp ? KEY_UP_DELAY : (nextHitObject.StartTime - endTime) * 0.9;
|
||||||
|
|
||||||
Frames.Add(new TaikoReplayFrame(endTime + calculatedDelay));
|
Frames.Add(new TaikoReplayFrame(endTime + calculatedDelay));
|
||||||
|
|
||||||
if (i < Beatmap.HitObjects.Count - 1)
|
|
||||||
{
|
|
||||||
double waitTime = Beatmap.HitObjects[i + 1].StartTime - 1000;
|
|
||||||
if (waitTime > endTime)
|
|
||||||
Frames.Add(new TaikoReplayFrame(waitTime));
|
|
||||||
}
|
|
||||||
|
|
||||||
hitButton = !hitButton;
|
hitButton = !hitButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Replay;
|
return Replay;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override HitObject GetNextObject(int currentIndex)
|
|
||||||
{
|
|
||||||
Type desiredType = Beatmap.HitObjects[currentIndex].GetType();
|
|
||||||
|
|
||||||
for (int i = currentIndex + 1; i < Beatmap.HitObjects.Count; i++)
|
|
||||||
{
|
|
||||||
var currentObj = Beatmap.HitObjects[i];
|
|
||||||
|
|
||||||
if (currentObj.GetType() == desiredType ||
|
|
||||||
// Un-press all keys before a DrumRoll or Swell
|
|
||||||
currentObj is DrumRoll || currentObj is Swell)
|
|
||||||
{
|
|
||||||
return Beatmap.HitObjects[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user