1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 03:02:54 +08:00

Clamp beat divisor to sane range when decoding

In my view this is a nice change, but do note that on its own it does
nothing to fix https://github.com/ppy/osu/issues/29492, because of
`BeatmapInfo` reference management foibles when opening the editor. See
also: https://github.com/ppy/osu/issues/20883#issuecomment-1288149271,
https://github.com/ppy/osu/pull/28473.
This commit is contained in:
Bartłomiej Dach 2024-08-20 13:40:57 +02:00
parent bb964e32fa
commit c2dd2ad978
No known key found for this signature in database

View File

@ -16,6 +16,7 @@ using osu.Game.Rulesets;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Legacy;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Screens.Edit;
namespace osu.Game.Beatmaps.Formats
{
@ -336,7 +337,7 @@ namespace osu.Game.Beatmaps.Formats
break;
case @"BeatDivisor":
beatmap.BeatmapInfo.BeatDivisor = Parsing.ParseInt(pair.Value);
beatmap.BeatmapInfo.BeatDivisor = Math.Clamp(Parsing.ParseInt(pair.Value), BindableBeatDivisor.MINIMUM_DIVISOR, BindableBeatDivisor.MAXIMUM_DIVISOR);
break;
case @"GridSize":