From caee40df5da03eb2db6ed8d528f1561ef9bcbd34 Mon Sep 17 00:00:00 2001 From: Fate Date: Tue, 9 Dec 2008 08:37:38 -0700 Subject: Status particle effects: when looking up block IDs (effect IDs for other players), make sure to initialise if needed Status particle effects: properly delete particles after effect has worn off --- src/being.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index 85807b2f..2be72360 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -432,6 +432,7 @@ Being::setStatusEffectBlock(int offset, Uint16 newEffects) { for (int i = 0; i < STATUS_EFFECTS; i++) { int index = StatusEffect::blockEffectIndexToEffectIndex(offset + i); + if (index != -1) setStatusEffect(index, (newEffects & (1 << i)) > 0); } @@ -451,13 +452,12 @@ Being::handleStatusEffect(StatusEffect *effect, int effectId) Particle *particle = effect->getParticle(); - if (particle) { - if (effectId >= 0) - mStatusParticleEffects.setLocally(effectId, particle); - else { - mStunParticleEffects.clearLocally(); + if (effectId >= 0) + mStatusParticleEffects.setLocally(effectId, particle); + else { + mStunParticleEffects.clearLocally(); + if (particle) mStunParticleEffects.addLocally(particle); - } } } -- cgit v1.2.3-70-g09d2