mirror of
https://github.com/ppy/osu
synced 2024-12-27 09:23:15 +00:00
Fix incorrect bank set / sample addition logic
Closes https://github.com/ppy/osu/issues/29361. Typical case of a few early-returns gone wrong leading to `NodeSamples` not being checked correctly.
This commit is contained in:
parent
3202c77279
commit
c9f1ef5361
@ -229,7 +229,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
EditorBeatmap.PerformOnSelection(h =>
|
EditorBeatmap.PerformOnSelection(h =>
|
||||||
{
|
{
|
||||||
if (h.Samples.All(s => s.Bank == bankName))
|
if (hasRelevantBank(h))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
h.Samples = h.Samples.Select(s => s.With(newBank: bankName)).ToList();
|
h.Samples = h.Samples.Select(s => s.With(newBank: bankName)).ToList();
|
||||||
@ -269,10 +269,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
EditorBeatmap.PerformOnSelection(h =>
|
EditorBeatmap.PerformOnSelection(h =>
|
||||||
{
|
{
|
||||||
// Make sure there isn't already an existing sample
|
// Make sure there isn't already an existing sample
|
||||||
if (h.Samples.Any(s => s.Name == sampleName))
|
if (h.Samples.All(s => s.Name != sampleName))
|
||||||
return;
|
h.Samples.Add(h.CreateHitSampleInfo(sampleName));
|
||||||
|
|
||||||
h.Samples.Add(h.CreateHitSampleInfo(sampleName));
|
|
||||||
|
|
||||||
if (h is IHasRepeats hasRepeats)
|
if (h is IHasRepeats hasRepeats)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user