diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/being/actorsprite.cpp | 32 | ||||
-rw-r--r-- | src/being/actorsprite.h | 1 | ||||
-rw-r--r-- | src/being/localplayer.cpp | 2 | ||||
-rw-r--r-- | src/being/localplayer.h | 1 |
4 files changed, 26 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); } } diff --git a/src/being/actorsprite.h b/src/being/actorsprite.h index 5f5bcbe5d..4e6d38b73 100644 --- a/src/being/actorsprite.h +++ b/src/being/actorsprite.h @@ -223,6 +223,7 @@ class ActorSprite notfinal : public CompoundSprite, public Actor */ virtual void handleStatusEffect(const StatusEffect *const effect, const int32_t effectId, + const Enable newStatus, const IsStart start); void setupSpriteDisplay(const SpriteDisplay &display, diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index a385cf0f7..23186dc2c 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -1004,10 +1004,12 @@ void LocalPlayer::setGotoTarget(Being *const target) void LocalPlayer::handleStatusEffect(const StatusEffect *const effect, const int32_t effectId, + const Enable newStatus, const IsStart start) { Being::handleStatusEffect(effect, effectId, + newStatus, start); if (effect) diff --git a/src/being/localplayer.h b/src/being/localplayer.h index 72c4d7258..7a3985a32 100644 --- a/src/being/localplayer.h +++ b/src/being/localplayer.h @@ -437,6 +437,7 @@ class LocalPlayer final : public Being, void handleStatusEffect(const StatusEffect *const effect, const int32_t effectId, + const Enable newStatus, const IsStart start) override final; void startWalking(const unsigned char dir); |