diff options
author | Shocker <shocker@freakz.ro> | 2012-09-05 00:13:43 +0300 |
---|---|---|
committer | Shocker <shocker@freakz.ro> | 2012-09-05 00:13:43 +0300 |
commit | ed6b58b17db7d00ee3ef5dd6f2cce50f72b8871f (patch) | |
tree | 787f270d8b9826caa843d3edecaffb1ccdf976f9 | |
parent | de15f7050142ab1c4b537d51185bf78e310ee918 (diff) |
Core/Spells: Avoid unnecessary code execution for SPELL_ATTR3_NO_DONE_BONUS
-rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index b4be74cd3c4..5d397790b44 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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()) |