diff options
author | Stijn Buys <ingar@osirion.org> | 2008-07-26 16:48:21 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-07-26 16:48:21 +0000 |
commit | 7c5ccbafdf9f72b7b572f2285d126a0a4e9aac74 (patch) | |
tree | 8c8faadbbd889dbd8e4656c95ca0b013a0aec134 | |
parent | ab0e9f429d15fa779b7bc0f145fc5e84eddf93be (diff) |
better fix
-rw-r--r-- | src/render/draw.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc index 5403172..2e72529 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -727,8 +727,10 @@ void draw_pass_model_fx(float elapsed) float fraction = entity->state()->state_engine_trail_offset; fraction += elapsed * 4.0f * u; - while (fraction - 1.0001f > 0) + if (fraction > 1.0f) fraction -= 1.0f; + math::clamp(fraction, 0.0f, 1.0f); + entity->state()->state_engine_trail_offset = fraction; for(model::Model::Engines::iterator eit = entity->model()->engines().begin(); eit != entity->model()->engines().end(); eit++) { |