1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 14:12:56 +08:00

Fix undo not behaving as expected sometimes

This commit is contained in:
Bartłomiej Dach 2023-05-22 22:45:39 +02:00
parent e0b7539c2a
commit 38b4bd8aef
No known key found for this signature in database

View File

@ -108,6 +108,11 @@ namespace osu.Game.Screens.Edit
foreach (var (oldObject, newObject) in oldObjects.Zip(newObjects))
{
// if `oldObject` and `newObject` are the same, it means that `oldObject` was inserted into `editorBeatmap` by `processHitObjects()`.
// in that case, there is nothing to do (and some of the subsequent changes may even prove destructive).
if (ReferenceEquals(oldObject, newObject))
continue;
if (oldObject is IHasSliderVelocity oldWithVelocity && newObject is IHasSliderVelocity newWithVelocity)
oldWithVelocity.SliderVelocity = newWithVelocity.SliderVelocity;