diff options
author | n0n4m3 <none@none> | 2010-01-13 14:31:57 +0300 |
---|---|---|
committer | n0n4m3 <none@none> | 2010-01-13 14:31:57 +0300 |
commit | 0bcf3b32f14d02452ced1f27ee203ffd389020d7 (patch) | |
tree | d004e8c9566be3eea0790b545aea12f717109979 | |
parent | 067de4b5ccd9fcfe48279eb0792f54ef4ffd3474 (diff) |
Fixed insane damage from some spells in case of negative spell.
--HG--
branch : trunk
-rw-r--r-- | src/game/Unit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 95360052238..b09e414e4ff 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10018,7 +10018,7 @@ int32 Unit::SpellBaseDamageBonus(SpellSchoolMask schoolMask) DoneAdvertisedBenefit += int32(GetTotalAttackPowerValue(BASE_ATTACK) * (*i)->GetAmount() / 100.0f); } - return DoneAdvertisedBenefit; + return DoneAdvertisedBenefit > 0 ? DoneAdvertisedBenefit : 0; } int32 Unit::SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit *pVictim) @@ -10038,7 +10038,7 @@ int32 Unit::SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit *pVic if (((*i)->GetMiscValue() & schoolMask) != 0) TakenAdvertisedBenefit += (*i)->GetAmount(); - return TakenAdvertisedBenefit; + return TakenAdvertisedBenefit > 0 ? TakenAdvertisedBenefit : 0; } bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType) const |