summaryrefslogtreecommitdiff
path: root/src/particle
diff options
context:
space:
mode:
Diffstat (limited to 'src/particle')
-rw-r--r--src/particle/particle.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/particle/particle.cpp b/src/particle/particle.cpp
index aeb79a1b1..4bf01207c 100644
--- a/src/particle/particle.cpp
+++ b/src/particle/particle.cpp
@@ -158,14 +158,14 @@ void Particle::updateSelf() restrict2
}
}
- if (mRandomness > 0)
+ if (mRandomness >= 10) // reduce useless calculations
{
const int rand2 = mRandomness * 2;
- mVelocity.x += static_cast<float>(rand() % rand2 - mRandomness)
+ mVelocity.x += static_cast<float>(std::rand() % rand2 - mRandomness)
/ 1000.0F;
- mVelocity.y += static_cast<float>(rand() % rand2 - mRandomness)
+ mVelocity.y += static_cast<float>(std::rand() % rand2 - mRandomness)
/ 1000.0F;
- mVelocity.z += static_cast<float>(rand() % rand2 - mRandomness)
+ mVelocity.z += static_cast<float>(std::rand() % rand2 - mRandomness)
/ 1000.0F;
}