mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 16:13:34 +08:00
Remove manual breaks at the start/end of beatmap
This is the secondary cause of https://github.com/ppy/osu/issues/28577, because you could do the following: - Have a break autogenerate itself - Adjust either end of it to make it mark itself as manually-adjusted - Remove all objects before or after said break to end up in a state wherein there are no objects before or after a break. The direct fix is still correct because it is still technically possible to end up in a state wherein a break is before or after all objects (obvious one is manual `.osu` editing), but this behaviour is also undesirable for the autogeneration logic.
This commit is contained in:
parent
18e2a925a8
commit
fae6dcfffa
@ -40,8 +40,12 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
foreach (var manualBreak in Beatmap.Breaks.ToList())
|
||||
{
|
||||
if (Beatmap.HitObjects.Any(ho => ho.StartTime <= manualBreak.EndTime && ho.GetEndTime() >= manualBreak.StartTime))
|
||||
if (manualBreak.EndTime <= Beatmap.HitObjects.FirstOrDefault()?.StartTime
|
||||
|| manualBreak.StartTime >= Beatmap.HitObjects.LastOrDefault()?.GetEndTime()
|
||||
|| Beatmap.HitObjects.Any(ho => ho.StartTime <= manualBreak.EndTime && ho.GetEndTime() >= manualBreak.StartTime))
|
||||
{
|
||||
Beatmap.Breaks.Remove(manualBreak);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 1; i < Beatmap.HitObjects.Count; ++i)
|
||||
|
Loading…
Reference in New Issue
Block a user