diff --git a/src/model.rs b/src/model.rs index 6eb57d8..686c040 100755 --- a/src/model.rs +++ b/src/model.rs @@ -309,7 +309,8 @@ pub struct Lod { } pub struct MDL { - pub lods : Vec + pub lods : Vec, + pub affected_bone_names : Vec } impl MDL { @@ -342,6 +343,21 @@ impl MDL { let model = ModelData::read(&mut cursor).unwrap(); + let mut affected_bone_names = vec![]; + + for mut offset in model.bone_name_offsets { + let mut string = String::new(); + + let mut next_char = model.header.strings[offset as usize] as char; + while next_char != '\0' { + string.push(next_char); + offset += 1; + next_char = model.header.strings[offset as usize] as char; + } + + affected_bone_names.push(string); + } + let mut lods = vec![]; for i in 0..model.header.lod_count { @@ -415,7 +431,8 @@ impl MDL { } Some(MDL { - lods + lods, + affected_bone_names }) } } \ No newline at end of file