mirror of
https://codeberg.org/icewind/vbsp.git
synced 2026-06-03 18:54:05 +02:00
fix ElementCount (too many) for LightColor
This commit is contained in:
parent
105296bbae
commit
a6bb2aba5c
1 changed files with 24 additions and 22 deletions
|
|
@ -231,28 +231,30 @@ impl FromStr for LightColor {
|
||||||
|
|
||||||
fn from_str(str: &str) -> Result<Self, Self::Err> {
|
fn from_str(str: &str) -> Result<Self, Self::Err> {
|
||||||
let mut values = str.split(' ');
|
let mut values = str.split(' ');
|
||||||
Ok(LightColor {
|
let r = values
|
||||||
r: values
|
.next()
|
||||||
.next()
|
.ok_or(EntityParseError::ElementCount)?
|
||||||
.ok_or(EntityParseError::ElementCount)?
|
.parse()
|
||||||
.parse()
|
.map_err(EntityParseError::Int)?;
|
||||||
.map_err(EntityParseError::Int)?,
|
let g = values
|
||||||
g: values
|
.next()
|
||||||
.next()
|
.ok_or(EntityParseError::ElementCount)?
|
||||||
.ok_or(EntityParseError::ElementCount)?
|
.parse()
|
||||||
.parse()
|
.map_err(EntityParseError::Int)?;
|
||||||
.map_err(EntityParseError::Int)?,
|
let b = values
|
||||||
b: values
|
.next()
|
||||||
.next()
|
.ok_or(EntityParseError::ElementCount)?
|
||||||
.ok_or(EntityParseError::ElementCount)?
|
.parse()
|
||||||
.parse()
|
.map_err(EntityParseError::Int)?;
|
||||||
.map_err(EntityParseError::Int)?,
|
let intensity = values
|
||||||
intensity: values
|
.next()
|
||||||
.next()
|
.ok_or(EntityParseError::ElementCount)?
|
||||||
.ok_or(EntityParseError::ElementCount)?
|
.parse()
|
||||||
.parse()
|
.map_err(EntityParseError::Int)?;
|
||||||
.map_err(EntityParseError::Int)?,
|
if values.next().is_some() {
|
||||||
})
|
return Err(EntityParseError::ElementCount);
|
||||||
|
}
|
||||||
|
Ok(LightColor { r, g, b, intensity })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue