From cca1dbbcba03e5c50e92096503b612fba5b399a2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 18 Oct 2015 17:56:41 +0300 Subject: Add logging for not implimemted effects. --- src/being/actorsprite.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/being/actorsprite.cpp') diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp index 951243cc7..0518c82fa 100644 --- a/src/being/actorsprite.cpp +++ b/src/being/actorsprite.cpp @@ -30,6 +30,8 @@ #include "gui/theme.h" +#include "listeners/debugmessagelistener.h" + #include "particle/particle.h" #include "resources/resourcemanager.h" @@ -198,13 +200,22 @@ void ActorSprite::setStatusEffectBlock(const int offset, { for (unsigned i = 0; i < STATUS_EFFECTS; i++) { + const bool val = (newEffects & (1 << i)) > 0; const int index = StatusEffect::blockEffectIndexToEffectIndex( offset + i); if (index != -1) { - setStatusEffect(index, - fromBool((newEffects & (1 << i)) > 0, Enable)); + setStatusEffect(index, fromBool(val, Enable)); + } + else if (val && config.getBoolValue("unimplimentedLog")) + { + const std::string str = strprintf( + "Error: unknown effect by block-index. " + "Offset: %d, effect int: %d, i: %u", + offset, (int)newEffects, i); + logger->log(str); + DebugMessageListener::distributeEvent(str); } } } -- cgit v1.2.3-60-g2f50