From a2c77bd2f8110c505464077c22d489d6a6d4c8c8 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Tue, 19 May 2020 15:24:28 +0200 Subject: add CbtStateChange::Unknown This is not defined by arcdps, but we'd have to adjust evtclib every time a new statechange is introduced. This way, we stay forward-compatible. --- src/raw/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/raw/parser.rs') diff --git a/src/raw/parser.rs b/src/raw/parser.rs index bf61f8c..8401146 100644 --- a/src/raw/parser.rs +++ b/src/raw/parser.rs @@ -350,7 +350,7 @@ pub fn parse_event_rev0(mut input: R) -> ParseResult { let is_fifty = input.read_u8()? != 0; let is_moving = input.read_u8()? != 0; let is_statechange = - CbtStateChange::from_u8(input.read_u8()?).ok_or(ParseError::InvalidData)?; + CbtStateChange::from_u8(input.read_u8()?).unwrap_or(CbtStateChange::Unknown); let is_flanking = input.read_u8()? != 0; let is_shields = input.read_u8()? != 0; @@ -411,7 +411,7 @@ pub fn parse_event_rev1(mut input: R) -> ParseResult { let is_fifty = input.read_u8()? != 0; let is_moving = input.read_u8()? != 0; let is_statechange = - CbtStateChange::from_u8(input.read_u8()?).ok_or(ParseError::InvalidData)?; + CbtStateChange::from_u8(input.read_u8()?).unwrap_or(CbtStateChange::Unknown); let is_flanking = input.read_u8()? != 0; let is_shields = input.read_u8()? != 0; let is_offcycle = input.read_u8()? != 0; -- cgit v1.2.3