Core/Spells: Avoid unnecessary code execution for SPELL_ATTR3_NO_DONE_BONUS

This commit is contained in:
Shocker
2012-09-05 00:13:43 +03:00
parent de15f70501
commit ed6b58b17d
+4 -7
View File
@@ -10298,6 +10298,10 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
if (!spellProto || !victim || damagetype == DIRECT_DAMAGE)
return pdamage;
// Some spells don't benefit from done mods
if (spellProto->AttributesEx3 & SPELL_ATTR3_NO_DONE_BONUS)
return pdamage;
// small exception for Deep Wounds, can't find any general rule
// should ignore ALL damage mods, they already calculated in trigger spell
if (spellProto->Id == 12721) // Deep Wounds
@@ -10699,13 +10703,6 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod);
}
// Some spells don't benefit from done mods
if (spellProto->AttributesEx3 & SPELL_ATTR3_NO_DONE_BONUS)
{
DoneTotal = 0;
DoneTotalMod = 1.0f;
}
float tmpDamage = (int32(pdamage) + DoneTotal) * DoneTotalMod;
// apply spellmod to Done damage (flat and pct)
if (Player* modOwner = GetSpellModOwner())