diff options
author | Fedja Beader <fedja@protonmail.ch> | 2025-04-07 21:03:11 +0000 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2025-04-07 21:03:11 +0000 |
commit | bd5a30eaaf29ba676a9300b80e89ccf218d964dd (patch) | |
tree | 53706907a0c0ca2778101328c9d1326784de5693 | |
parent | aa4e09c04525af94fa48d99c99266e21a3176dd9 (diff) | |
download | plus-bd5a30eaaf29ba676a9300b80e89ccf218d964dd.tar.gz plus-bd5a30eaaf29ba676a9300b80e89ccf218d964dd.tar.bz2 plus-bd5a30eaaf29ba676a9300b80e89ccf218d964dd.tar.xz plus-bd5a30eaaf29ba676a9300b80e89ccf218d964dd.zip |
un-newline too much newlining in actorsprite.cpp
pathJoin indent is probably going to annoy a linter, got a patch ready
if that happens. Not ideal but better than now.
****
mana/plus!162
-rw-r--r-- | src/being/actorsprite.cpp | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp index 030c67f56..25a118f88 100644 --- a/src/being/actorsprite.cpp +++ b/src/being/actorsprite.cpp @@ -124,9 +124,7 @@ void ActorSprite::logic() if (effect != nullptr && effect->mIsPersistent) { - updateStatusEffect(*it, - Enable_true, - IsStart_false); + updateStatusEffect(*it, Enable_true, IsStart_false); } } } @@ -228,9 +226,7 @@ static void applyEffectByOption(ActorSprite *const actor, const Enable enable = (opt & option) != 0 ? Enable_true : Enable_false; option |= opt; option ^= opt; - actor->setStatusEffect(id, - enable, - IsStart_false); + actor->setStatusEffect(id, enable, IsStart_false); } if (option != 0U && config.getBoolValue("unimplimentedLog")) @@ -256,16 +252,12 @@ static void applyEffectByOption1(ActorSprite *const actor, const int32_t id = (*it).second; if (opt == option) { - actor->setStatusEffect(id, - Enable_true, - IsStart_false); + actor->setStatusEffect(id, Enable_true, IsStart_false); option = 0U; } else { - actor->setStatusEffect(id, - Enable_false, - IsStart_false); + actor->setStatusEffect(id, Enable_false, IsStart_false); } } if (option != 0 && @@ -318,8 +310,9 @@ void ActorSprite::updateStatusEffect(const int32_t index, const Enable newStatus, const IsStart start) { - StatusEffect *const effect = StatusEffectDB::getStatusEffect( - index, newStatus); + StatusEffect *const effect + = StatusEffectDB::getStatusEffect(index, newStatus); + if (effect == nullptr) return; if (effect->mIsPoison && getType() == ActorType::Player) @@ -385,9 +378,10 @@ void ActorSprite::setupSpriteDisplay(const SpriteDisplay &display, { if (display.image.empty()) { - addSprite(AnimatedSprite::delayedLoad(pathJoin( - paths.getStringValue("sprites"), - paths.getStringValue("spriteErrorFile")), + addSprite(AnimatedSprite::delayedLoad( + pathJoin( + paths.getStringValue("sprites"), + paths.getStringValue("spriteErrorFile")), 0)); } else @@ -524,10 +518,9 @@ std::string ActorSprite::getStatusEffectsString() const { FOR_EACH (std::set<int32_t>::const_iterator, it, mStatusEffects) { - const StatusEffect *const effect = - StatusEffectDB::getStatusEffect( - *it, - Enable_true); + const StatusEffect *const effect + = StatusEffectDB::getStatusEffect(*it, Enable_true); + if (effect == nullptr) continue; if (!effectsStr.empty()) |