It doesn't appear to be an error to have an invalid instrument index

This commit is contained in:
Gwilym Inzani 2024-08-28 12:13:08 +01:00
parent a79829068c
commit 53182d8122

View file

@ -112,8 +112,10 @@ pub fn parse_module(module: &Module) -> agb_tracker_interop::Track {
} else {
let instrument_index = (slot.instrument - 1) as usize;
if let InstrumentType::Default(ref instrument) =
module.instrument[instrument_index].instr_type
if let Some(InstrumentType::Default(ref instrument)) = module
.instrument
.get(instrument_index)
.map(|instrument| &instrument.instr_type)
{
let sample_slot = *instrument
.sample_for_note