aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnubisss <none@none>2009-08-26 17:56:35 +0200
committerAnubisss <none@none>2009-08-26 17:56:35 +0200
commitcda2fc2ecb4bd57b9a02c373396163097dc71093 (patch)
treeb08003393f990aca4e63ccb3530dcd0140f139de
parent0b7a89e3b00cf66913d7533921e93ff496c0ef43 (diff)
*Fix the bug that Steady Shot make too much(over million) damage with these items: 42946, 44093.
--HG-- branch : trunk
-rw-r--r--src/game/SpellEffects.cpp9
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;
}
}