1
0
Fork 0
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:
Quaternions 2025-02-13 16:13:40 -08:00
commit a6bb2aba5c

View file

@ -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)?;
g: values let g = values
.next() .next()
.ok_or(EntityParseError::ElementCount)? .ok_or(EntityParseError::ElementCount)?
.parse() .parse()
.map_err(EntityParseError::Int)?, .map_err(EntityParseError::Int)?;
b: values let b = values
.next() .next()
.ok_or(EntityParseError::ElementCount)? .ok_or(EntityParseError::ElementCount)?
.parse() .parse()
.map_err(EntityParseError::Int)?, .map_err(EntityParseError::Int)?;
intensity: values let 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 })
} }
} }