1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-05 09:42:54 +08:00

improve conversion process to reduce breakage in rare cases

This commit is contained in:
Hiviexd 2024-11-22 11:21:48 +01:00
parent d4f29487d3
commit 93e7afd5f3
2 changed files with 11 additions and 10 deletions

View File

@ -31,8 +31,8 @@ namespace osu.Game.Rulesets.Taiko.Tests.Mods
new Hit { StartTime = 1000, Type = HitType.Centre },
new Hit { StartTime = 1500, Type = HitType.Centre },
new Hit { StartTime = 2000, Type = HitType.Centre },
new Hit { StartTime = 2333, Type = HitType.Centre }, // mod moves this to 2500
new Hit { StartTime = 2666, Type = HitType.Rim }, // mod removes this
new Hit { StartTime = 2333, Type = HitType.Rim }, // mod removes this
new Hit { StartTime = 2666, Type = HitType.Centre }, // mod moves this to 2500
new Hit { StartTime = 3000, Type = HitType.Centre },
new Hit { StartTime = 3500, Type = HitType.Centre },
},
@ -71,8 +71,8 @@ namespace osu.Game.Rulesets.Taiko.Tests.Mods
new Hit { StartTime = 1000, Type = HitType.Centre },
new Hit { StartTime = 1250, Type = HitType.Centre },
new Hit { StartTime = 1500, Type = HitType.Centre },
new Hit { StartTime = 1666, Type = HitType.Centre }, // mod moves this to 1750
new Hit { StartTime = 1833, Type = HitType.Rim }, // mod removes this
new Hit { StartTime = 1666, Type = HitType.Rim }, // mod removes this
new Hit { StartTime = 1833, Type = HitType.Centre }, // mod moves this to 1750
new Hit { StartTime = 2000, Type = HitType.Centre },
new Hit { StartTime = 2250, Type = HitType.Centre },
},
@ -110,7 +110,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Mods
new Hit { StartTime = 1000, Type = HitType.Centre },
new Hit { StartTime = 1250, Type = HitType.Centre },
new Hit { StartTime = 1500, Type = HitType.Centre },
new Hit { StartTime = 1625, Type = HitType.Rim }, // mod removes this
new Hit { StartTime = 1625, Type = HitType.Rim }, // mod removes this
new Hit { StartTime = 1750, Type = HitType.Centre },
new Hit { StartTime = 2000, Type = HitType.Centre },
},

View File

@ -95,15 +95,16 @@ namespace osu.Game.Rulesets.Taiko.Mods
}
else
{
// 1/6 and 1/3: Adjust the second note and remove the third
// 1/6 and 1/3: Remove the second note and adjust the third
if (currentHitPosition % 3 == 1)
{
hits[j].StartTime = hits[j - 1].StartTime + (controlPointInfo.TimingPointAt(hits[j].StartTime).BeatLength / Convert.ToDouble(snapConversion.Value));
}
else if (currentHitPosition % 3 == 2)
{
toRemove.Add(hits[j]);
}
else if (currentHitPosition % 3 == 2 && j < hits.Count - 1)
{
double offset = controlPointInfo.TimingPointAt(hits[j].StartTime).BeatLength / Convert.ToDouble(snapConversion.Value);
hits[j].StartTime = hits[j + 1].StartTime - offset;
}
}
}
}