Core/Items: fixed handling of Heirloom item stat distribution

This commit is contained in:
Ovahlord committed 2020-01-26 07:41:51 +01:00
1 parent ee41e6260d
commit 603b71d2a7
2 files changed
+12 -6

No files matched your search

+1 -1
View File
@@ -610,7 +610,7 @@ inline uint8 ItemSubClassToDurabilityMultiplierId(uint32 ItemClass, uint32 ItemS
struct _ItemStat
{
uint32 ItemStatType;
int32 ItemStatType;
int32 ItemStatValue;
int32 ItemStatAllocation;
int32 ItemStatSocketCostMultiplier;
+11 -5
View File
@@ -7657,14 +7657,20 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
for (uint8 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
{
int32 statType = proto->ItemStat[i].ItemStatType;
// Fallback to stat scaling distribution stat ID. If no entry, skip
if (statType == -1 && !ssd)
continue;
else if (ssd)
statType = ssd->StatID[i];
int32 val = proto->GetStatValue(i, this);
// If set ScalingStatDistribution need get stats and values from it
if (ssd && ssd->StatID[i] < 0)
if (!val)
continue;
uint32 statType = proto->ItemStat[i].ItemStatType;
if (val == 0)
// If set ScalingStatDistribution need get stats and values from it
if (ssd && ssd->StatID[i] < 0)
continue;
switch (statType)