summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-21 20:49:47 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-21 20:49:47 +0300
commitd65b19913092fa0ebe8848c0c902e6ee487d55c9 (patch)
treeaca426a47726fc92b031f55a57d37ed63c682864
parent8e832312082e0f260d559c321ee081aa3b806361 (diff)
downloadmv-d65b19913092fa0ebe8848c0c902e6ee487d55c9.tar.gz
mv-d65b19913092fa0ebe8848c0c902e6ee487d55c9.tar.bz2
mv-d65b19913092fa0ebe8848c0c902e6ee487d55c9.tar.xz
mv-d65b19913092fa0ebe8848c0c902e6ee487d55c9.zip
Fix reading opt1 field. This is not bit field.
-rw-r--r--src/being/actorsprite.cpp35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp
index aab26690a..5334bcb6a 100644
--- a/src/being/actorsprite.cpp
+++ b/src/being/actorsprite.cpp
@@ -241,6 +241,37 @@ static void applyEffectByOption(ActorSprite *const actor,
}
}
+static void applyEffectByOption1(ActorSprite *const actor,
+ uint32_t option,
+ const char *const name,
+ const OptionsMap& options)
+{
+ FOR_EACH (OptionsMapCIter, it, options)
+ {
+ const int opt = (*it).first;
+ const int id = (*it).second;
+ if (opt == option)
+ {
+ actor->setStatusEffect(id, Enable_true);
+ option = 0U;
+ }
+ else
+ {
+ actor->setStatusEffect(id, Enable_false);
+ }
+ }
+ 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,
const uint32_t opt1,
const uint32_t opt2,
@@ -250,7 +281,7 @@ void ActorSprite::setStatusEffectOpitons(const uint32_t option,
{
applyEffectByOption(this, option, "option",
StatusEffectDB::getOptionMap());
- applyEffectByOption(this, opt1, "opt1",
+ applyEffectByOption1(this, opt1, "opt1",
StatusEffectDB::getOpt1Map());
applyEffectByOption(this, opt2, "opt2",
StatusEffectDB::getOpt2Map());
@@ -279,7 +310,7 @@ void ActorSprite::setStatusEffectOpitons(const uint32_t option,
{
applyEffectByOption(this, option, "option",
StatusEffectDB::getOptionMap());
- applyEffectByOption(this, opt1, "opt1",
+ applyEffectByOption1(this, opt1, "opt1",
StatusEffectDB::getOpt1Map());
applyEffectByOption(this, opt2, "opt2",
StatusEffectDB::getOpt2Map());