Skip to content

Commit

Permalink
default to survival mode when GameMode is out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Dec 16, 2023
1 parent 9260892 commit a960dba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion azalea-core/src/game_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl GameMode {
impl McBufReadable for GameMode {
fn read_from(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> {
let id = u8::read_from(buf)?;
GameMode::from_id(id).ok_or(BufReadError::UnexpectedEnumVariant { id: id as i32 })
Ok(GameMode::from_id(id).unwrap_or_default())
}
}

Expand Down

0 comments on commit a960dba

Please sign in to comment.