summaryrefslogtreecommitdiff
path: root/src/particle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/particle.cpp')
-rw-r--r--src/particle.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/particle.cpp b/src/particle.cpp
index 3e5bda24f..2b019ab3f 100644
--- a/src/particle.cpp
+++ b/src/particle.cpp
@@ -134,9 +134,11 @@ bool Particle::update()
dist.x * dist.x + dist.y * dist.y + dist.z * dist.z);
break;
case 2:
- invHypotenuse = 0;
if (!dist.x)
+ {
+ invHypotenuse = 0;
break;
+ }
invHypotenuse = 2.0f / (static_cast<float>(fabs(dist.x))
+ static_cast<float>(fabs(dist.y))