From cda2fc2ecb4bd57b9a02c373396163097dc71093 Mon Sep 17 00:00:00 2001 From: Anubisss Date: Wed, 26 Aug 2009 17:56:35 +0200 Subject: *Fix the bug that Steady Shot make too much(over million) damage with these items: 42946, 44093. --HG-- branch : trunk --- src/game/SpellEffects.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/game/SpellEffects.cpp') diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 30fe8af0d0a..ffb7260d2f1 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -588,7 +588,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) } } - //TODO: should this be put on taken but not done? + // TODO: should this be put on taken but not done? if(found) damage += m_spellInfo->EffectBasePoints[1]; @@ -598,7 +598,12 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) Item *item = ((Player*)m_caster)->GetWeaponForAttack(RANGED_ATTACK); if(item) { - damage += urand(uint32(item->GetProto()->Damage->DamageMin), uint32(item->GetProto()->Damage->DamageMax)); + float dmg_min = item->GetProto()->Damage->DamageMin; + float dmg_max = item->GetProto()->Damage->DamageMax; + if(dmg_max == 0.0f && dmg_min > dmg_max) + damage += uint32(dmg_min); + else + damage += urand(uint32(dmg_min), uint32(dmg_max)); damage += ((Player*)m_caster)->GetAmmoDPS()*item->GetProto()->Delay/1000; } } -- cgit v1.2.3