summaryrefslogtreecommitdiff
path: root/src/being/actorsprite.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-30 20:10:30 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-30 20:21:39 +0300
commit753f7335b3eb5a6637611045bd1a5d4238a47e12 (patch)
tree81e47e0380e1af058a8ab01aa014c6cfbbbb5ed3 /src/being/actorsprite.cpp
parent205ed1edc60277c6ae8cc4383ab24535b36f7761 (diff)
downloadmv-753f7335b3eb5a6637611045bd1a5d4238a47e12.tar.gz
mv-753f7335b3eb5a6637611045bd1a5d4238a47e12.tar.bz2
mv-753f7335b3eb5a6637611045bd1a5d4238a47e12.tar.xz
mv-753f7335b3eb5a6637611045bd1a5d4238a47e12.zip
Fix removing particle effects after end effect message.
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);
}
}