Core/Spells: Fixed combat log for spells that affect item durability

This commit is contained in:
Shauren committed 2012-11-25 11:13:39 +01:00
1 parent 00044b5d32
commit ba18fe1e56
3 files changed
+9 -8

No files matched your search

+5 -4
View File
@@ -5400,11 +5400,11 @@ void Spell::EffectDurabilityDamage(SpellEffIndex effIndex)
int32 slot = m_spellInfo->Effects[effIndex].MiscValue;
// FIXME: some spells effects have value -1/-2
// Possibly its mean -1 all player equipped items and -2 all items
// -1 means all player equipped items and -2 all items
if (slot < 0)
{
unitTarget->ToPlayer()->DurabilityPointsLossAll(damage, (slot < -1));
ExecuteLogEffectDurabilityDamage(effIndex, unitTarget, -1, -1);
return;
}
@@ -5413,9 +5413,10 @@ void Spell::EffectDurabilityDamage(SpellEffIndex effIndex)
return;
if (Item* item = unitTarget->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
{
unitTarget->ToPlayer()->DurabilityPointsLoss(item, damage);
ExecuteLogEffectDurabilityDamage(effIndex, unitTarget, slot, damage);
ExecuteLogEffectDurabilityDamage(effIndex, unitTarget, item->GetEntry(), slot);
}
}
void Spell::EffectDurabilityDamagePCT(SpellEffIndex effIndex)