Core/Items: Fixed item spell charge slot indexing

Port From (https://github.com/TrinityCore/TrinityCore/commit/c85d12fc3f0576163d4ffa91bb38f66894305349)
This commit is contained in:
Hondacrx
2025-06-08 15:09:36 -04:00
parent aa4975855c
commit 57b2c5b550
6 changed files with 56 additions and 45 deletions
+1 -2
View File
@@ -4900,8 +4900,7 @@ namespace Game.Spells
if (item != null)
{
foreach (ItemEffectRecord itemEffect in item.GetEffects())
if (itemEffect.LegacySlotIndex <= item.m_itemData.SpellCharges.GetSize())
item.SetSpellCharges(itemEffect.LegacySlotIndex, itemEffect.Charges);
item.SetSpellCharges(itemEffect, itemEffect.Charges);
item.SetState(ItemUpdateState.Changed, player);
}