mirror of
https://github.com/osukey/osukey.git
synced 2025-06-20 18:58:05 +09:00
Merge pull request #4496 from smoogipoo/reinstantiate-mods
Fix mods being reused for difficulty calculation
This commit is contained in:
commit
fe255c54d0
@ -37,6 +37,8 @@ namespace osu.Game.Rulesets.Difficulty
|
|||||||
/// <returns>A structure describing the difficulty of the beatmap.</returns>
|
/// <returns>A structure describing the difficulty of the beatmap.</returns>
|
||||||
public DifficultyAttributes Calculate(params Mod[] mods)
|
public DifficultyAttributes Calculate(params Mod[] mods)
|
||||||
{
|
{
|
||||||
|
mods = mods.Select(m => m.CreateCopy()).ToArray();
|
||||||
|
|
||||||
beatmap.Mods.Value = mods;
|
beatmap.Mods.Value = mods;
|
||||||
IBeatmap playableBeatmap = beatmap.GetPlayableBeatmap(ruleset.RulesetInfo);
|
IBeatmap playableBeatmap = beatmap.GetPlayableBeatmap(ruleset.RulesetInfo);
|
||||||
|
|
||||||
|
@ -65,5 +65,10 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public virtual Type[] IncompatibleMods => new Type[] { };
|
public virtual Type[] IncompatibleMods => new Type[] { };
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a copy of this <see cref="Mod"/> initialised to a default state.
|
||||||
|
/// </summary>
|
||||||
|
public virtual Mod CreateCopy() => (Mod)Activator.CreateInstance(GetType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user