Fix handling of XXXX fields in plugin header

This commit is contained in:
Tyler Hallada 2021-07-21 22:22:49 -04:00
parent bb08e26b95
commit 979f70177e

View File

@ -336,7 +336,11 @@ fn parse_plugin_header(input: &[u8]) -> IResult<&[u8], PluginHeader> {
let mut large_size = None; let mut large_size = None;
while consumed_bytes < tes4.size as u32 { while consumed_bytes < tes4.size as u32 {
let (remaining, field) = parse_field_header(input)?; let (remaining, field) = parse_field_header(input)?;
if let Some(size) = large_size {
consumed_bytes += size + FIELD_HEADER_SIZE;
} else {
consumed_bytes += field.size as u32 + FIELD_HEADER_SIZE; consumed_bytes += field.size as u32 + FIELD_HEADER_SIZE;
}
input = remaining; input = remaining;
match field.field_type { match field.field_type {
"CNAM" => { "CNAM" => {