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/statuseffect.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/statuseffect.cpp') diff --git a/src/statuseffect.cpp b/src/statuseffect.cpp index eeae45d8..8aeb66c6 100644 --- a/src/statuseffect.cpp +++ b/src/statuseffect.cpp @@ -91,6 +91,7 @@ static std::map blockEffectIndexMap; int StatusEffect::blockEffectIndexToEffectIndex(int blockIndex) { + load(); if (blockEffectIndexMap.find(blockIndex) == blockEffectIndexMap.end()) return -1; return blockEffectIndexMap[blockIndex]; @@ -142,6 +143,7 @@ void StatusEffect::load() if (index >= 0 && block_index >= 0) blockEffectIndexMap[block_index] = index; + } else if (xmlStrEqual(node->name, BAD_CAST "stun-effect")) the_map = &stunEffects; @@ -159,6 +161,8 @@ void StatusEffect::load() endEffect->mSFXEffect = XML::getProperty(node, "end-audio", ""); endEffect->mParticleEffect = XML::getProperty(node, "end-particle", ""); + endEffect->mPersistentParticleEffect = (XML::getProperty(node, "persistent-particle-effect", "no")) != "no"; + (*the_map)[1][index] = startEffect; (*the_map)[0][index] = endEffect; } -- cgit v1.2.3-60-g2f50