summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-21 20:04:23 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-21 20:04:23 +0300
commit4aabd8991aac14641b9cdf14f1a944a026123254 (patch)
tree92cbb8d62e3c455afc92e6b7d1ec019865015c30 /src
parent8800940bb4b94f6dab7dcf80bf0abc3e3b09e35f (diff)
downloadmanaverse-4aabd8991aac14641b9cdf14f1a944a026123254.tar.gz
manaverse-4aabd8991aac14641b9cdf14f1a944a026123254.tar.bz2
manaverse-4aabd8991aac14641b9cdf14f1a944a026123254.tar.xz
manaverse-4aabd8991aac14641b9cdf14f1a944a026123254.zip
Add report about missing option, opt1, opt2, opt3 fields in status-effects.xml
Diffstat (limited to 'src')
-rw-r--r--src/being/actorsprite.cpp39
1 files changed, 30 insertions, 9 deletions
diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp
index df8f14fdf..aab26690a 100644
--- a/src/being/actorsprite.cpp
+++ b/src/being/actorsprite.cpp
@@ -216,7 +216,8 @@ void ActorSprite::setStatusEffectBlock(const int offset,
}
static void applyEffectByOption(ActorSprite *const actor,
- const uint32_t option,
+ uint32_t option,
+ const char *const name,
const OptionsMap& options)
{
FOR_EACH (OptionsMapCIter, it, options)
@@ -224,8 +225,20 @@ static void applyEffectByOption(ActorSprite *const actor,
const int opt = (*it).first;
const int id = (*it).second;
const Enable enable = (opt & option) != 0 ? Enable_true : Enable_false;
+ option |= opt;
+ option ^= opt;
actor->setStatusEffect(id, enable);
}
+ if (option && config.getBoolValue("unimplimentedLog"))
+ {
+ const std::string str = strprintf(
+ "Error: unknown effect by %s. "
+ "Left value: %u",
+ name,
+ option);
+ logger->log(str);
+ DebugMessageListener::distributeEvent(str);
+ }
}
void ActorSprite::setStatusEffectOpitons(const uint32_t option,
@@ -235,10 +248,14 @@ void ActorSprite::setStatusEffectOpitons(const uint32_t option,
{
if (settings.legacyEffects == false)
{
- applyEffectByOption(this, option, StatusEffectDB::getOptionMap());
- applyEffectByOption(this, opt1, StatusEffectDB::getOpt1Map());
- applyEffectByOption(this, opt2, StatusEffectDB::getOpt2Map());
- applyEffectByOption(this, opt3, StatusEffectDB::getOpt3Map());
+ applyEffectByOption(this, option, "option",
+ StatusEffectDB::getOptionMap());
+ applyEffectByOption(this, opt1, "opt1",
+ StatusEffectDB::getOpt1Map());
+ applyEffectByOption(this, opt2, "opt2",
+ StatusEffectDB::getOpt2Map());
+ applyEffectByOption(this, opt3, "opt3",
+ StatusEffectDB::getOpt3Map());
}
else
{
@@ -260,9 +277,12 @@ void ActorSprite::setStatusEffectOpitons(const uint32_t option,
{
if (settings.legacyEffects == false)
{
- applyEffectByOption(this, option, StatusEffectDB::getOptionMap());
- applyEffectByOption(this, opt1, StatusEffectDB::getOpt1Map());
- applyEffectByOption(this, opt2, StatusEffectDB::getOpt2Map());
+ applyEffectByOption(this, option, "option",
+ StatusEffectDB::getOptionMap());
+ applyEffectByOption(this, opt1, "opt1",
+ StatusEffectDB::getOpt1Map());
+ applyEffectByOption(this, opt2, "opt2",
+ StatusEffectDB::getOpt2Map());
}
else
{
@@ -280,7 +300,8 @@ void ActorSprite::setStatusEffectOpiton0(const uint32_t option)
{
if (settings.legacyEffects == false)
{
- applyEffectByOption(this, option, StatusEffectDB::getOptionMap());
+ applyEffectByOption(this, option, "option",
+ StatusEffectDB::getOptionMap());
}
else
{