add some missing commands

This commit is contained in:
yuni 2024-03-30 19:54:01 +01:00
parent 40cb0d6398
commit de8eb23d91

View file

@ -219,6 +219,7 @@ struct ParserState {
mass: f32,
collider: Collider,
camdistance: f32,
suit_integrity: f32,
// Chat fields
delay: f64,
@ -263,6 +264,7 @@ impl Default for ParserState {
mass: 1.0,
collider: Collider::sphere(1.0),
camdistance: default_actor.camdistance,
suit_integrity: 1.0,
delay: 0.0,
text: "".to_string(),
@ -352,6 +354,7 @@ impl ParserState {
actor.insert(actor::Suit {
oxygen: self.oxygen,
oxygen_max: nature::OXY_D,
integrity: self.suit_integrity,
..default()
});
}
@ -531,6 +534,18 @@ pub fn load_defs(
["engine", "ion"] => {
state.engine_type = actor::EngineType::Ion;
}
["engine", "monopropellant"] => {
state.engine_type = actor::EngineType::Monopropellant;
}
["health", value] => {
if let Ok(value_float) = value.parse::<f32>() {
state.suit_integrity = value_float;
}
else {
error!("Can't parse float: {line}");
continue;
}
}
["mass", value] => {
if let Ok(value_float) = value.parse::<f32>() {
state.mass = value_float;