From 485614608bdf75527a4d85d2bb3a1f2eba43cbdb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 21:01:15 +0000 Subject: [PATCH 2/2] Apply PR feedback: bounds check, DivineAura client guard, levitate dedup Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com> --- zone/spell_effects.cpp | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 62814dae9..6328f9a22 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -4222,7 +4222,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) // Re-applies runtime-only buff effects after unsuppression or zone-in void Mob::ReapplyBuffEffects(uint32 index, bool from_suppress) { - if (!IsValidSpell(buffs[index].spellid)) { + if (index >= GetMaxTotalSlots() || !IsValidSpell(buffs[index].spellid)) { return; } @@ -4268,7 +4268,9 @@ void Mob::ReapplyBuffEffects(uint32 index, bool from_suppress) } case SpellEffect::DivineAura: { - SetInvul(true); + if (IsClient()) { + SetInvul(true); + } break; } case SpellEffect::Invisibility2: @@ -4298,26 +4300,13 @@ void Mob::ReapplyBuffEffects(uint32 index, bool from_suppress) } } + auto fly_mode = (spell.limit_value[i] == 1) + ? EQ::constants::GravityBehavior::LevitateWhileRunning + : EQ::constants::GravityBehavior::Levitating; if (IsClient()) { - SendAppearancePacket( - AppearanceType::FlyMode, - ( - spell.limit_value[i] == 1 ? - EQ::constants::GravityBehavior::LevitateWhileRunning : - EQ::constants::GravityBehavior::Levitating - ), - true, - !from_suppress - ); + SendAppearancePacket(AppearanceType::FlyMode, fly_mode, true, !from_suppress); } else { - SendAppearancePacket( - AppearanceType::FlyMode, - ( - spell.limit_value[i] == 1 ? - EQ::constants::GravityBehavior::LevitateWhileRunning : - EQ::constants::GravityBehavior::Levitating - ) - ); + SendAppearancePacket(AppearanceType::FlyMode, fly_mode); } break;