mirror of https://github.com/ppy/osu
Use constant for maximum legacy ruleset id
This commit is contained in:
parent
52e50db6b9
commit
eb75a29b20
|
@ -9,6 +9,7 @@
|
|||
using osu.Game.Beatmaps;
|
||||
using osu.Game.IO.Legacy;
|
||||
using osu.Game.Replays.Legacy;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Replays;
|
||||
using osu.Game.Rulesets.Replays.Types;
|
||||
using SharpCompress.Compressors.LZMA;
|
||||
|
@ -47,7 +48,7 @@ public LegacyScoreEncoder(Score score, IBeatmap? beatmap)
|
|||
if (beatmap == null && !score.Replay.Frames.All(f => f is LegacyReplayFrame))
|
||||
throw new ArgumentException(@"Beatmap must be provided if frames are not already legacy frames.", nameof(beatmap));
|
||||
|
||||
if (score.ScoreInfo.Ruleset.OnlineID < 0 || score.ScoreInfo.Ruleset.OnlineID > 3)
|
||||
if (score.ScoreInfo.Ruleset.OnlineID < 0 || score.ScoreInfo.Ruleset.OnlineID > ILegacyRuleset.MAX_LEGACY_RULESET_ID)
|
||||
throw new ArgumentException(@"Only scores in the osu, taiko, catch, or mania rulesets can be encoded to the legacy score format.", nameof(score));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue