Change CopyFrom to always overwrite all settings with incoming values

This commit is contained in:
Dean Herbert 2021-02-09 13:44:11 +09:00
parent 3133ccacfa
commit be379e0e3c

View File

@ -134,7 +134,7 @@ namespace osu.Game.Rulesets.Mods
} }
/// <summary> /// <summary>
/// Copies mod setting values from <paramref name="source"/> into this instance. /// Copies mod setting values from <paramref name="source"/> into this instance, overwriting all existing settings.
/// </summary> /// </summary>
/// <param name="source">The mod to copy properties from.</param> /// <param name="source">The mod to copy properties from.</param>
public void CopyFrom(Mod source) public void CopyFrom(Mod source)
@ -147,9 +147,7 @@ namespace osu.Game.Rulesets.Mods
var targetBindable = (IBindable)prop.GetValue(this); var targetBindable = (IBindable)prop.GetValue(this);
var sourceBindable = (IBindable)prop.GetValue(source); var sourceBindable = (IBindable)prop.GetValue(source);
// we only care about changes that have been made away from defaults. CopyAdjustedSetting(targetBindable, sourceBindable);
if (!sourceBindable.IsDefault)
CopyAdjustedSetting(targetBindable, sourceBindable);
} }
} }