mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 16:52:54 +08:00
Fix hit object coordinates being truncated to int
values
Closes https://github.com/ppy/osu/issues/29340.
This commit is contained in:
parent
2114f092c7
commit
d072c6a743
@ -18,6 +18,12 @@ namespace osu.Game.Beatmaps.Formats
|
||||
{
|
||||
public const int LATEST_VERSION = 14;
|
||||
|
||||
/// <summary>
|
||||
/// The .osu format (beatmap) version.
|
||||
///
|
||||
/// osu!stable's versions end at <see cref="LATEST_VERSION"/>.
|
||||
/// osu!lazer's versions starts at <see cref="LegacyBeatmapEncoder.FIRST_LAZER_VERSION"/>.
|
||||
/// </summary>
|
||||
protected readonly int FormatVersion;
|
||||
|
||||
protected LegacyDecoder(int version)
|
||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
protected readonly double Offset;
|
||||
|
||||
/// <summary>
|
||||
/// The beatmap version.
|
||||
/// The .osu format (beatmap) version.
|
||||
/// </summary>
|
||||
protected readonly int FormatVersion;
|
||||
|
||||
@ -48,7 +48,10 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
{
|
||||
string[] split = text.Split(',');
|
||||
|
||||
Vector2 pos = new Vector2((int)Parsing.ParseFloat(split[0], Parsing.MAX_COORDINATE_VALUE), (int)Parsing.ParseFloat(split[1], Parsing.MAX_COORDINATE_VALUE));
|
||||
Vector2 pos =
|
||||
FormatVersion >= LegacyBeatmapEncoder.FIRST_LAZER_VERSION
|
||||
? new Vector2(Parsing.ParseFloat(split[0], Parsing.MAX_COORDINATE_VALUE), Parsing.ParseFloat(split[1], Parsing.MAX_COORDINATE_VALUE))
|
||||
: new Vector2((int)Parsing.ParseFloat(split[0], Parsing.MAX_COORDINATE_VALUE), (int)Parsing.ParseFloat(split[1], Parsing.MAX_COORDINATE_VALUE));
|
||||
|
||||
double startTime = Parsing.ParseDouble(split[2]) + Offset;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user