From de8eb23d91d46998015f67664d933e4e74160178 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 30 Mar 2024 19:54:01 +0100 Subject: [PATCH] add some missing commands --- src/world.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/world.rs b/src/world.rs index b78fbec..a340ffc 100644 --- a/src/world.rs +++ b/src/world.rs @@ -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::() { + state.suit_integrity = value_float; + } + else { + error!("Can't parse float: {line}"); + continue; + } + } ["mass", value] => { if let Ok(value_float) = value.parse::() { state.mass = value_float;