mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
It doesn't appear to be an error to have an invalid instrument index (#755)
I've seen an xm file that plays fine in milkytracker and other places, but has instrument indexes which are too high. They are just treated as non-existent :) - [x] no changelog update needed
This commit is contained in:
commit
605173bf65
|
@ -112,8 +112,10 @@ pub fn parse_module(module: &Module) -> agb_tracker_interop::Track {
|
||||||
} else {
|
} else {
|
||||||
let instrument_index = (slot.instrument - 1) as usize;
|
let instrument_index = (slot.instrument - 1) as usize;
|
||||||
|
|
||||||
if let InstrumentType::Default(ref instrument) =
|
if let Some(InstrumentType::Default(ref instrument)) = module
|
||||||
module.instrument[instrument_index].instr_type
|
.instrument
|
||||||
|
.get(instrument_index)
|
||||||
|
.map(|instrument| &instrument.instr_type)
|
||||||
{
|
{
|
||||||
let sample_slot = *instrument
|
let sample_slot = *instrument
|
||||||
.sample_for_note
|
.sample_for_note
|
||||||
|
|
Loading…
Reference in a new issue