xact3::xwb: Number sounds when no names are found

This is a workaround as in the long run names should be read from the
corresponding sound bank.
master
Simon Bruder 2020-06-23 14:32:00 +02:00
parent dbc42a4083
commit a1ba24bc87
No known key found for this signature in database
GPG Key ID: 6F03E0000CC5B62F
1 changed files with 6 additions and 2 deletions

View File

@ -196,8 +196,12 @@ impl WaveBank<'_> {
debug!("Parsing entries (length {})", segments[1].len());
let entries = exec_nom_parser(count(Entry::parse, info.entry_count as usize), segments[1])?;
debug!("Parsing entry names (length {})", segments[3].len());
let entry_names =
exec_nom_parser(count(take_str64, info.entry_count as usize), segments[3])?;
let entry_names = if segments[3].len() == info.entry_count as usize * 64 {
exec_nom_parser(count(take_str64, info.entry_count as usize), segments[3])?
} else {
warn!("File does not have name entries");
(0..info.entry_count).map(|x| x.to_string()).collect()
};
let mut wave_bank = WaveBank {
name: info.name,