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.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp
index bbb016525..29fa1290c 100644
--- a/src/being/actorsprite.cpp
+++ b/src/being/actorsprite.cpp
@@ -37,6 +37,7 @@
#include "resources/resourcemanager.h"
#include "utils/checkutils.h"
+#include "utils/delete2.h"
#include "utils/timer.h"
#include "debug.h"
@@ -57,7 +58,8 @@ ActorSprite::ActorSprite(const int id) :
mActorSpriteListeners(),
mCursorPaddingX(0),
mCursorPaddingY(0),
- mMustResetParticles(false)
+ mMustResetParticles(false),
+ mPoison(false)
{
}
@@ -197,7 +199,13 @@ void ActorSprite::updateStunMode(const int oldMode, const int newMode)
void ActorSprite::updateStatusEffect(const int index, const bool newStatus)
{
- handleStatusEffect(StatusEffect::getStatusEffect(index, newStatus), index);
+ StatusEffect *const effect = StatusEffect::getStatusEffect(
+ index, newStatus);
+ if (!effect)
+ return;
+ if (effect->isPoison() && getType() == PLAYER)
+ setPoison(newStatus);
+ handleStatusEffect(effect, index);
}
void ActorSprite::handleStatusEffect(StatusEffect *const effect,
@@ -372,10 +380,7 @@ void ActorSprite::cleanupTargetCursors()
for (int type = TCT_NORMAL; type < NUM_TCT; type++)
{
if (targetCursor[type][size])
- {
- delete targetCursor[type][size];
- targetCursor[type][size] = nullptr;
- }
+ delete2(targetCursor[type][size])
}
}
}