summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2008-12-09 08:37:38 -0700
committerFate <fate-tmw@googlemail.com>2008-12-09 08:37:38 -0700
commitcaee40df5da03eb2db6ed8d528f1561ef9bcbd34 (patch)
tree898b2f02f0109864aff772567abb2c37d9ab5149 /src/being.cpp
parentb8cca9c48d6ea5a2372e10bbe2a75ae95917db42 (diff)
downloadmana-client-caee40df5da03eb2db6ed8d528f1561ef9bcbd34.tar.gz
mana-client-caee40df5da03eb2db6ed8d528f1561ef9bcbd34.tar.bz2
mana-client-caee40df5da03eb2db6ed8d528f1561ef9bcbd34.tar.xz
mana-client-caee40df5da03eb2db6ed8d528f1561ef9bcbd34.zip
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
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp12
1 files changed, 6 insertions, 6 deletions
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);
- }
}
}