fix(Core/Items): skip empty stats instead of stopping on them (#25671)

This commit is contained in:
Tereneckla
2026-05-02 00:31:07 +00:00
committed by GitHub
parent b801931f0a
commit 55c231ae04

View File

@@ -3332,12 +3332,14 @@ void ObjectMgr::LoadItemTemplates()
itemTemplate.ContainerSlots = uint32(fields[26].Get<uint8>());
uint8 statsCount = 0;
while (statsCount < MAX_ITEM_PROTO_STATS)
uint8 statsIterator = 0;
while (statsIterator < MAX_ITEM_PROTO_STATS)
{
uint32 statType = uint32(fields[27 + statsCount * 2].Get<uint8>());
int32 statValue = fields[28 + statsCount * 2].Get<int32>();
if (statType == 0)
break;
uint32 statType = uint32(fields[27 + statsIterator * 2].Get<uint8>());
int32 statValue = fields[28 + statsIterator * 2].Get<int32>();
statsIterator++;
if (statValue == 0)
continue;
itemTemplate.ItemStat[statsCount].ItemStatType = statType;
itemTemplate.ItemStat[statsCount].ItemStatValue = statValue;