From ed6b58b17db7d00ee3ef5dd6f2cce50f72b8871f Mon Sep 17 00:00:00 2001 From: Shocker Date: Wed, 5 Sep 2012 00:13:43 +0300 Subject: Core/Spells: Avoid unnecessary code execution for SPELL_ATTR3_NO_DONE_BONUS --- src/server/game/Entities/Unit/Unit.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src') 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()) -- cgit v1.2.3