add some missing commands
This commit is contained in:
parent
40cb0d6398
commit
de8eb23d91
15
src/world.rs
15
src/world.rs
|
@ -219,6 +219,7 @@ struct ParserState {
|
||||||
mass: f32,
|
mass: f32,
|
||||||
collider: Collider,
|
collider: Collider,
|
||||||
camdistance: f32,
|
camdistance: f32,
|
||||||
|
suit_integrity: f32,
|
||||||
|
|
||||||
// Chat fields
|
// Chat fields
|
||||||
delay: f64,
|
delay: f64,
|
||||||
|
@ -263,6 +264,7 @@ impl Default for ParserState {
|
||||||
mass: 1.0,
|
mass: 1.0,
|
||||||
collider: Collider::sphere(1.0),
|
collider: Collider::sphere(1.0),
|
||||||
camdistance: default_actor.camdistance,
|
camdistance: default_actor.camdistance,
|
||||||
|
suit_integrity: 1.0,
|
||||||
|
|
||||||
delay: 0.0,
|
delay: 0.0,
|
||||||
text: "".to_string(),
|
text: "".to_string(),
|
||||||
|
@ -352,6 +354,7 @@ impl ParserState {
|
||||||
actor.insert(actor::Suit {
|
actor.insert(actor::Suit {
|
||||||
oxygen: self.oxygen,
|
oxygen: self.oxygen,
|
||||||
oxygen_max: nature::OXY_D,
|
oxygen_max: nature::OXY_D,
|
||||||
|
integrity: self.suit_integrity,
|
||||||
..default()
|
..default()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -531,6 +534,18 @@ pub fn load_defs(
|
||||||
["engine", "ion"] => {
|
["engine", "ion"] => {
|
||||||
state.engine_type = actor::EngineType::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] => {
|
["mass", value] => {
|
||||||
if let Ok(value_float) = value.parse::<f32>() {
|
if let Ok(value_float) = value.parse::<f32>() {
|
||||||
state.mass = value_float;
|
state.mass = value_float;
|
||||||
|
|
Loading…
Reference in a new issue