mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
default to survival mode when GameMode is out of bounds
This commit is contained in:
parent
9260892d44
commit
a960dba87d
1 changed files with 1 additions and 1 deletions
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue