Core/Spells: improve integer to float conversions and checks for spell proc entries
This commit is contained in:
1 parent
fd22ea32e6
commit
5f2b1e45e4
2 files changed
+13
-13
No files matched your search
@@ -7987,7 +7987,7 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT
|
||||
if (m_extraAttacks && spellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS))
|
||||
return;
|
||||
|
||||
float chance = (float)spellInfo->ProcChance;
|
||||
float chance = static_cast<float>(spellInfo->ProcChance);
|
||||
|
||||
if (proto->SpellPPMRate)
|
||||
{
|
||||
@@ -8048,10 +8048,10 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT
|
||||
float chance = pEnchant->EffectPointsMin[s] != 0 ? float(pEnchant->EffectPointsMin[s]) : GetWeaponProcChance();
|
||||
if (entry)
|
||||
{
|
||||
if (entry->ProcsPerMinute)
|
||||
if (entry->ProcsPerMinute != 0.f)
|
||||
chance = GetPPMProcChance(proto->GetDelay(), entry->ProcsPerMinute, spellInfo);
|
||||
else if (entry->Chance)
|
||||
chance = (float)entry->Chance;
|
||||
else if (entry->Chance != 0.f)
|
||||
chance = entry->Chance;
|
||||
}
|
||||
|
||||
// Apply spell mods
|
||||
|
||||
Reference in new issue
Block a user