Apply PR feedback: bounds check, DivineAura client guard, levitate dedup

Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-03-09 21:01:15 +00:00
parent 8fcfb265cb
commit 485614608b

View File

@ -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 // Re-applies runtime-only buff effects after unsuppression or zone-in
void Mob::ReapplyBuffEffects(uint32 index, bool from_suppress) void Mob::ReapplyBuffEffects(uint32 index, bool from_suppress)
{ {
if (!IsValidSpell(buffs[index].spellid)) { if (index >= GetMaxTotalSlots() || !IsValidSpell(buffs[index].spellid)) {
return; return;
} }
@ -4268,7 +4268,9 @@ void Mob::ReapplyBuffEffects(uint32 index, bool from_suppress)
} }
case SpellEffect::DivineAura: case SpellEffect::DivineAura:
{ {
SetInvul(true); if (IsClient()) {
SetInvul(true);
}
break; break;
} }
case SpellEffect::Invisibility2: 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()) { if (IsClient()) {
SendAppearancePacket( SendAppearancePacket(AppearanceType::FlyMode, fly_mode, true, !from_suppress);
AppearanceType::FlyMode,
(
spell.limit_value[i] == 1 ?
EQ::constants::GravityBehavior::LevitateWhileRunning :
EQ::constants::GravityBehavior::Levitating
),
true,
!from_suppress
);
} else { } else {
SendAppearancePacket( SendAppearancePacket(AppearanceType::FlyMode, fly_mode);
AppearanceType::FlyMode,
(
spell.limit_value[i] == 1 ?
EQ::constants::GravityBehavior::LevitateWhileRunning :
EQ::constants::GravityBehavior::Levitating
)
);
} }
break; break;