fix(tracker): loading preset did not update the ids

When a preset was loaded, its IDs were not updated,
causing ID collisions in the song and send targets
going wrong.
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2024-08-10 15:14:54 +03:00
parent db2d9cac9d
commit e09af5ab34
2 changed files with 5 additions and 1 deletions

View File

@ -145,7 +145,9 @@ func (m *Model) LoadPreset(index int) Action {
for m.d.InstrIndex >= len(m.d.Song.Patch) {
m.d.Song.Patch = append(m.d.Song.Patch, defaultInstrument.Copy())
}
m.d.Song.Patch[m.d.InstrIndex] = instrumentPresets[index].Copy()
newInstr := instrumentPresets[index].Copy()
(*Model)(m).assignUnitIDs(newInstr.Units)
m.d.Song.Patch[m.d.InstrIndex] = newInstr
}, allowed: func() bool {
return true
}}