mirror of
https://codeberg.org/icewind/vbsp.git
synced 2026-06-04 11:04:07 +02:00
dont panic when parsing invalid displacement neighbours
This commit is contained in:
parent
148c6c59bd
commit
f22ee95214
5 changed files with 39 additions and 18 deletions
14
src/error.rs
14
src/error.rs
|
|
@ -1,8 +1,8 @@
|
|||
use crate::bspfile::LumpType;
|
||||
use crate::data::*;
|
||||
use std::num::{ParseFloatError, ParseIntError};
|
||||
use thiserror::Error;
|
||||
use zip::result::ZipError;
|
||||
use crate::bspfile::LumpType;
|
||||
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Error)]
|
||||
|
|
@ -105,6 +105,18 @@ pub enum ValidationError {
|
|||
NonSquareDisplacement(i16),
|
||||
#[error("No static prop lump found")]
|
||||
NoStaticPropLump,
|
||||
#[error(transparent)]
|
||||
Neighbour(InvalidNeighbourError),
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum InvalidNeighbourError {
|
||||
#[error("Invalid neighbour span")]
|
||||
InvalidNeighbourIndex,
|
||||
#[error("Invalid neighbour span")]
|
||||
InvalidNeighbourSpan(u8),
|
||||
#[error("Invalid neighbour orientation")]
|
||||
InvalidNeighbourOrientation(u8),
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue