Core/Spells: Replace MAX_SPELL_EFFECTS loop limits with correct upper bound depending on how many effects the spell has

This commit is contained in:
Shauren
2025-01-09 17:48:41 +01:00
parent 97f58a59f1
commit 561b122364
6 changed files with 25 additions and 23 deletions

View File

@@ -118,7 +118,7 @@ uint32 SpellScriptBase::EffectHook::GetAffectedEffectsMask(SpellInfo const* spel
uint32 mask = 0;
if (_effIndex == EFFECT_ALL || _effIndex == EFFECT_FIRST_FOUND)
{
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
for (uint8 i = 0; i < spellInfo->GetEffects().size(); ++i)
{
if (_effIndex == EFFECT_FIRST_FOUND && mask)
return mask;