From bd5a30eaaf29ba676a9300b80e89ccf218d964dd Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Mon, 7 Apr 2025 21:03:11 +0000 Subject: 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 --- src/being/actorsprite.cpp | 35 ++++++++++++++--------------------- 1 file 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::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()) -- cgit v1.2.3-70-g09d2