mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 20:23:00 +08:00
Fix incorrect value copy order in BindTo()
This commit is contained in:
parent
f3fe472a33
commit
cce4a4dc31
@ -104,15 +104,17 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
if (!(them is DifficultyBindable otherDifficultyBindable))
|
if (!(them is DifficultyBindable otherDifficultyBindable))
|
||||||
throw new InvalidOperationException($"Cannot bind to a non-{nameof(DifficultyBindable)}.");
|
throw new InvalidOperationException($"Cannot bind to a non-{nameof(DifficultyBindable)}.");
|
||||||
|
|
||||||
base.BindTo(them);
|
|
||||||
|
|
||||||
CurrentNumber.BindTarget = otherDifficultyBindable.CurrentNumber;
|
|
||||||
ExtendedLimits.BindTarget = otherDifficultyBindable.ExtendedLimits;
|
|
||||||
ReadCurrentFromDifficulty = otherDifficultyBindable.ReadCurrentFromDifficulty;
|
ReadCurrentFromDifficulty = otherDifficultyBindable.ReadCurrentFromDifficulty;
|
||||||
|
|
||||||
// the following is only safe as long as these values are effectively constants.
|
// the following max value copies are only safe as long as these values are effectively constants.
|
||||||
MaxValue = otherDifficultyBindable.maxValue;
|
MaxValue = otherDifficultyBindable.maxValue;
|
||||||
ExtendedMaxValue = otherDifficultyBindable.extendedMaxValue;
|
ExtendedMaxValue = otherDifficultyBindable.extendedMaxValue;
|
||||||
|
|
||||||
|
ExtendedLimits.BindTarget = otherDifficultyBindable.ExtendedLimits;
|
||||||
|
|
||||||
|
// the actual values need to be copied after the max value constraints.
|
||||||
|
CurrentNumber.BindTarget = otherDifficultyBindable.CurrentNumber;
|
||||||
|
base.BindTo(them);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void UnbindFrom(IUnbindable them)
|
public override void UnbindFrom(IUnbindable them)
|
||||||
|
Loading…
Reference in New Issue
Block a user