diff options
author | Stijn Buys <ingar@osirion.org> | 2008-08-01 23:36:30 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-08-01 23:36:30 +0000 |
commit | 417485ca452b95b591af5fb639bf9bbb793e9912 (patch) | |
tree | cd30345a9f38dcbf1a2b5a2cd34d1f144dbd72dc /src | |
parent | e5a14a1e1a6d822b3b97df803c91727b16d770d2 (diff) |
fix thruster jitter
Diffstat (limited to 'src')
-rw-r--r-- | src/game/ship.cc | 4 |
1 files changed, 4 insertions, 0 deletions
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); |