summaryrefslogtreecommitdiff
path: root/src/rotationalparticle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rotationalparticle.cpp')
-rw-r--r--src/rotationalparticle.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rotationalparticle.cpp b/src/rotationalparticle.cpp
index cd16ddf63..60d818cd9 100644
--- a/src/rotationalparticle.cpp
+++ b/src/rotationalparticle.cpp
@@ -55,10 +55,13 @@ bool RotationalParticle::update()
// TODO: cache velocities to avoid spamming atan2()
+ int size = mAnimation->getLength();
+ if (!size)
+ return false;
+
float rad = static_cast<float>(atan2(mVelocity.x, mVelocity.y));
if (rad < 0)
rad = static_cast<float>(PI + (PI + rad));
- int size = mAnimation->getLength();
float range = static_cast<float>(PI / size);