diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SpellEffects.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
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; } } |