From 417485ca452b95b591af5fb639bf9bbb793e9912 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 1 Aug 2008 23:36:30 +0000 Subject: fix thruster jitter --- src/game/ship.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/game/ship.cc b/src/game/ship.cc index 14a5cc8..920bf43 100644 --- a/src/game/ship.cc +++ b/src/game/ship.cc @@ -190,8 +190,12 @@ void Ship::frame(float seconds) // update thrust if (entity_thrust < target_thrust) { entity_thrust += seconds * 0.5f; + if (entity_thrust > target_thrust) + entity_thrust = target_thrust; } else if (entity_thrust > target_thrust) { entity_thrust -= seconds * 0.5f; + if (entity_thrust < target_thrust) + entity_thrust = target_thrust; } math::clamp(entity_thrust, 0.0f, 1.0f); -- cgit v1.2.3