assets loaded by bank id instead of name (no more traps)

This commit is contained in:
2026-03-24 13:40:55 +00:00
parent 17878e481c
commit d5eb5cf033
9 changed files with 27 additions and 10 deletions
+6 -4
View File
@@ -183,10 +183,12 @@ impl Audio {
}
// Resolve the sample from the hardware pools
let sample = self
.sound_banks
.sound_bank_slot(bank_id as usize)
.and_then(|bank| bank.samples.get(sample_id as usize).map(Arc::clone));
let bank_slot = self.sound_banks.sound_bank_slot(bank_id as usize);
if bank_slot.is_none() {
return AudioOpStatus::BankInvalid;
}
let sample = bank_slot.and_then(|bank| bank.samples.get(sample_id as usize).map(Arc::clone));
if let Some(s) = sample {
// println!(