From 877bfe276efcf663de5a8af8fa9464aaf935ca2d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 8 Apr 2015 20:40:13 +0300 Subject: Simplify using rotational particle effect. --- src/being/being.cpp | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'src/being/being.cpp') diff --git a/src/being/being.cpp b/src/being/being.cpp index e37d29fd1..93dd6abc5 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1245,29 +1245,15 @@ void Being::setAction(const BeingAction::Action &action, const int attackId) reset(); // attack particle effect - if (Particle::enabled) + if (Particle::enabled && effectManager) { const int effectId = mInfo->getAttack(attackId)->mEffectId; - - int rotation; - switch (mSpriteDirection) + if (effectId >= 0) { - case SpriteDirection::DOWN: - default: - rotation = 0; - break; - case SpriteDirection::LEFT: - rotation = 90; - break; - case SpriteDirection::UP: - rotation = 180; - break; - case SpriteDirection::RIGHT: - rotation = 270; - break; + effectManager->triggerDirection(effectId, + this, + mSpriteDirection); } - if (effectManager && effectId >= 0) - effectManager->trigger(effectId, this, rotation); } } break; -- cgit v1.2.3-70-g09d2