mirror of
https://github.com/ppy/osu.git
synced 2026-05-17 19:04:00 +08:00
Limit beatmap encoder & decoder to at most 8 combo colours
This commit is contained in:
@@ -349,7 +349,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
|
||||
writer.WriteLine("[Colours]");
|
||||
|
||||
for (int i = 0; i < colours.Count; i++)
|
||||
for (int i = 0; i < Math.Min(colours.Count, LegacyBeatmapDecoder.MAX_COMBO_COLOUR_COUNT); i++)
|
||||
{
|
||||
var comboColour = colours[i];
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ namespace osu.Game.Beatmaps.Formats
|
||||
{
|
||||
public const int LATEST_VERSION = 14;
|
||||
|
||||
public const int MAX_COMBO_COLOUR_COUNT = 8;
|
||||
|
||||
/// <summary>
|
||||
/// The .osu format (beatmap) version.
|
||||
///
|
||||
@@ -126,7 +128,9 @@ namespace osu.Game.Beatmaps.Formats
|
||||
string[] split = pair.Value.Split(',');
|
||||
Color4 colour = convertSettingStringToColor4(split, allowAlpha, pair);
|
||||
|
||||
bool isCombo = pair.Key.StartsWith(@"Combo", StringComparison.Ordinal);
|
||||
bool isCombo = pair.Key.StartsWith(@"Combo", StringComparison.Ordinal)
|
||||
&& int.TryParse(pair.Key[5..], out int comboIndex)
|
||||
&& comboIndex >= 1 && comboIndex <= MAX_COMBO_COLOUR_COUNT;
|
||||
|
||||
if (isCombo)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user