summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-09 22:56:28 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-09 22:56:28 +0300
commite9cb948d49401d8b162c45b04a6e116a91359965 (patch)
tree75d68ae8fc1561413e855f32fea7b6d60961724b /src
parentdf092799e9bb64035db76a7b0eda8a9f5a7d5ba9 (diff)
downloadplus-e9cb948d49401d8b162c45b04a6e116a91359965.tar.gz
plus-e9cb948d49401d8b162c45b04a6e116a91359965.tar.bz2
plus-e9cb948d49401d8b162c45b04a6e116a91359965.tar.xz
plus-e9cb948d49401d8b162c45b04a6e116a91359965.zip
Show asserts for misisng effects.
Diffstat (limited to 'src')
-rw-r--r--src/effectmanager.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp
index e91e52eff..40d2b7f67 100644
--- a/src/effectmanager.cpp
+++ b/src/effectmanager.cpp
@@ -28,6 +28,8 @@
#include "being/being.h"
+#include "utils/checkutils.h"
+
#include "particle/particle.h"
#include "resources/beingcommon.h"
@@ -118,7 +120,7 @@ bool EffectManager::trigger(const int id,
Being *const being,
const int rotation)
{
- if (!being || !particleEngine)
+ if (!being || !particleEngine || id == -1)
return false;
BLOCK_START("EffectManager::trigger")
@@ -139,9 +141,10 @@ bool EffectManager::trigger(const int id,
soundManager.playSfx(effect.sfx);
if (!effect.sprite.empty())
being->addEffect(effect.sprite);
- break;
+ return rValue;
}
}
+ reportAlways("Missing effect %d", id);
BLOCK_END("EffectManager::trigger")
return rValue;
}
@@ -150,7 +153,7 @@ Particle *EffectManager::triggerReturn(const int id,
Being *const being,
const int rotation)
{
- if (!being || !particleEngine)
+ if (!being || !particleEngine || id == -1)
return nullptr;
Particle *rValue = nullptr;
@@ -169,9 +172,10 @@ Particle *EffectManager::triggerReturn(const int id,
soundManager.playSfx(effect.sfx);
if (!effect.sprite.empty())
being->addEffect(effect.sprite);
- break;
+ return rValue;
}
}
+ reportAlways("Missing effect %d", id);
return rValue;
}
@@ -180,7 +184,7 @@ bool EffectManager::trigger(const int id,
const int endTime,
const int rotation)
{
- if (!particleEngine)
+ if (!particleEngine || id == -1)
return false;
bool rValue = false;
@@ -202,9 +206,10 @@ bool EffectManager::trigger(const int id,
if (!effect.sfx.empty())
soundManager.playSfx(effect.sfx);
// TODO add sprite effect to position
- break;
+ return rValue;
}
}
+ reportAlways("Missing effect %d", id);
return rValue;
}