Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/render/draw.cc4
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++) {