summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/engines.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/modules/engines.rs b/src/modules/engines.rs
index ebf4e8b..9aa8297 100644
--- a/src/modules/engines.rs
+++ b/src/modules/engines.rs
@@ -40,14 +40,13 @@ impl Engines {
self.status = Status::None;
}
}
- match self.target_velocity.clone() {
- Some(target_velocity) => {
- self.acceleration += target_velocity - velocity;
- if self.acceleration == Vector::default() {
- self.target_velocity = None;
- }
+
+ if let Some(target_velocity) = self.target_velocity.clone() {
+ self.acceleration += target_velocity - velocity;
+ if self.acceleration == Vector::default() {
+ self.target_velocity = None;
+ self.status = Status::None;
}
- None => (),
}
}