Core/Spells: Replace MAX_SPELL_EFFECTS loop limits with correct upper bound depending on how many effects the spell has
Port From (https://github.com/TrinityCore/TrinityCore/commit/561b122364525deaee815ad900a78f1323c37776)
This commit is contained in:
@@ -2241,8 +2241,10 @@ namespace Game.Entities
|
||||
|
||||
RemoveOwnedAura(spellId, GetGUID());
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellId, Difficulty.None);
|
||||
|
||||
// remove pet auras
|
||||
for (byte i = 0; i < SpellConst.MaxEffects; ++i)
|
||||
for (byte i = 0; i < spellInfo.GetEffects().Count; ++i)
|
||||
{
|
||||
PetAura petSpell = Global.SpellMgr.GetPetAura(spellId, i);
|
||||
if (petSpell != null)
|
||||
@@ -2250,8 +2252,7 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
// update free primary prof.points (if not overflow setting, can be in case GM use before .learn prof. learning)
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellId, Difficulty.None);
|
||||
if (spellInfo != null && spellInfo.IsPrimaryProfessionFirstRank())
|
||||
if (spellInfo.IsPrimaryProfessionFirstRank())
|
||||
{
|
||||
uint freeProfs = GetFreePrimaryProfessionPoints() + 1;
|
||||
if (freeProfs <= WorldConfig.GetIntValue(WorldCfg.MaxPrimaryTradeSkill))
|
||||
|
||||
Reference in New Issue
Block a user