From 9bbd8b1c7039c046ca3992e4a9e1ceefda80f816 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Thu, 5 Apr 2018 02:20:27 -0500 Subject: -now targeting works after a delay --- src/ship.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ship.rs b/src/ship.rs index f56492e..090cd7d 100644 --- a/src/ship.rs +++ b/src/ship.rs @@ -89,8 +89,8 @@ impl Ship { pub fn give_target(&mut self, target : Option) { self.targeting.target = target; - self.targeting.status = TargetingStatus::Targeted; - //self.targeting.start = Some(SystemTime::now()); + self.targeting.status = TargetingStatus::Targeting; + self.targeting.start = Some(SystemTime::now()); } pub fn recv_target(&self) -> Option { @@ -114,7 +114,6 @@ impl Mass for Ship { self.position.0 += self.velocity.0; self.position.1 += self.velocity.1; self.position.2 += self.velocity.2; - /* match self.targeting.start { Some(time) => { if time.elapsed().unwrap().as_secs() > self.targeting.time { @@ -123,7 +122,6 @@ impl Mass for Ship { } None => (), } - */ } fn position(&self) -> (f64, f64, f64) { -- cgit v1.2.3