From c0a5fffb45f849e224750f27fa8c3be5ac447ad6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 14 Sep 2011 01:46:13 +0300 Subject: Add more checks. Fix error in event.cpp from last commits. Improve party members sorting. --- src/rotationalparticle.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/rotationalparticle.cpp') 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(atan2(mVelocity.x, mVelocity.y)); if (rad < 0) rad = static_cast(PI + (PI + rad)); - int size = mAnimation->getLength(); float range = static_cast(PI / size); -- cgit v1.2.3-60-g2f50