diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-01-23 14:58:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-01-23 14:58:38 +0300 |
commit | 20ffb556085e519f98a96f00257ee6b837116a8e (patch) | |
tree | 7fc55b3172ab67f54dbf7a9403085c6f2b186f86 /src | |
parent | fcddd8c0dab52900ded0c4faafd635aa6416425f (diff) | |
download | plus-20ffb556085e519f98a96f00257ee6b837116a8e.tar.gz plus-20ffb556085e519f98a96f00257ee6b837116a8e.tar.bz2 plus-20ffb556085e519f98a96f00257ee6b837116a8e.tar.xz plus-20ffb556085e519f98a96f00257ee6b837116a8e.zip |
Add some report checks to actorsprite.
Diffstat (limited to 'src')
-rw-r--r-- | src/actorsprite.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/actorsprite.cpp b/src/actorsprite.cpp index c1c139bb9..c718c31f2 100644 --- a/src/actorsprite.cpp +++ b/src/actorsprite.cpp @@ -39,6 +39,8 @@ #include "resources/imageset.h" #include "resources/resourcemanager.h" +#include "utils/checkutils.h" + #include "debug.h" #define EFFECTS_FILE "effects.xml" @@ -70,7 +72,7 @@ ActorSprite::~ActorSprite() for (ActorSpriteListenerIterator iter = mActorSpriteListeners.begin(), e = mActorSpriteListeners.end(); iter != e; ++iter) { - if (*iter) + if (reportFalse(*iter)) (*iter)->actorSpriteDestroyed(*this); } } @@ -245,7 +247,7 @@ void ActorSprite::setStatusEffectBlock(int offset, Uint16 newEffects) void ActorSprite::internalTriggerEffect(int effectId, bool sfx, bool gfx) { - if (!particleEngine) + if (reportTrue(!particleEngine)) return; if (player_node) @@ -256,13 +258,13 @@ void ActorSprite::internalTriggerEffect(int effectId, bool sfx, bool gfx) EffectDescription *ed = getEffectDescription(effectId); - if (!ed) + if (reportTrue(!ed)) { logger->log1("Unknown special effect and no default recorded"); return; } - if (gfx && !ed->mGFXEffect.empty() && particleEngine) + if (gfx && !ed->mGFXEffect.empty()) { Particle *selfFX; @@ -287,7 +289,7 @@ void ActorSprite::updateStatusEffect(int index, bool newStatus) void ActorSprite::handleStatusEffect(StatusEffect *effect, int effectId) { - if (!effect) + if (reportTrue(!effect)) return; // TODO: Find out how this is meant to be used @@ -392,7 +394,7 @@ void ActorSprite::load() void ActorSprite::unload() { - if (!loaded) + if (reportTrue(!loaded)) return; cleanupTargetCursors(); @@ -476,7 +478,7 @@ void ActorSprite::cleanupTargetCursors() void ActorSprite::loadTargetCursor(const std::string &filename, int width, int height, int type, int size) { - if (size < TC_SMALL || size >= NUM_TC) + if (reportTrue(size < TC_SMALL || size >= NUM_TC)) return; ImageSet *currentImageSet = Theme::getImageSetFromTheme( |