summaryrefslogtreecommitdiff
path: root/src/being/actorsprite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/being/actorsprite.cpp')
-rw-r--r--src/being/actorsprite.cpp32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp
index 56b21288d..c6346c721 100644
--- a/src/being/actorsprite.cpp
+++ b/src/being/actorsprite.cpp
@@ -208,9 +208,13 @@ void ActorSprite::setStatusEffect(const int32_t index,
{
updateStatusEffect(index, active, start);
if (active == Enable_true)
+ {
mStatusEffects.insert(index);
+ }
else
+ {
mStatusEffects.erase(index);
+ }
}
}
@@ -390,25 +394,33 @@ void ActorSprite::updateStatusEffect(const int32_t index,
setTrickDead(newStatus == Enable_true);
else if (effect->mIsPostDelay)
stopCast(newStatus == Enable_true);
- handleStatusEffect(effect, index, start);
+ handleStatusEffect(effect, index, newStatus, start);
}
void ActorSprite::handleStatusEffect(const StatusEffect *const effect,
const int32_t effectId,
+ const Enable newStatus,
const IsStart start)
{
- if (!effect)
+ if (effect == nullptr)
return;
- if (effectId >= 0)
+ if (newStatus == Enable_true)
+ {
+ if (effectId >= 0)
+ {
+ Particle *particle = nullptr;
+ if (start == IsStart_true)
+ particle = effect->getStartParticle();
+ if (!particle)
+ particle = effect->getParticle();
+ if (particle)
+ mStatusParticleEffects.setLocally(effectId, particle);
+ }
+ }
+ else
{
- Particle *particle = nullptr;
- if (start == IsStart_true)
- particle = effect->getStartParticle();
- if (!particle)
- particle = effect->getParticle();
- if (particle)
- mStatusParticleEffects.setLocally(effectId, particle);
+ mStatusParticleEffects.delLocally(effectId);
}
}