mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Spells: Fix some -Wconversion warnings
Attempt to fix #13152 by properly casting between data types during damage calculations.
This commit is contained in:
@@ -8156,9 +8156,9 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
float averageDmg = 0;
|
||||
// now compute approximate weapon damage by formula from wowwiki.com
|
||||
if (procFlags & PROC_FLAG_DONE_OFFHAND_ATTACK)
|
||||
averageDmg = (GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE) + GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE)) / 2;
|
||||
averageDmg = (GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE) + GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE)) / 2.f;
|
||||
else
|
||||
averageDmg = (GetFloatValue(UNIT_FIELD_MINDAMAGE) + GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2;
|
||||
averageDmg = (GetFloatValue(UNIT_FIELD_MINDAMAGE) + GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2.f;
|
||||
|
||||
basepoints0 = int32(averageDmg);
|
||||
break;
|
||||
|
||||
@@ -271,13 +271,13 @@ class spell_warr_deep_wounds : public SpellScriptLoader
|
||||
ApplyPct(damage, 16 * GetSpellInfo()->GetRank());
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC);
|
||||
uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude;
|
||||
uint32 ticks = uint32(spellInfo->GetDuration()) / spellInfo->Effects[EFFECT_0].Amplitude;
|
||||
|
||||
// Add remaining ticks to damage done
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC, EFFECT_0, caster->GetGUID()))
|
||||
damage += aurEff->GetDamage() * (ticks - aurEff->GetTickNumber());
|
||||
damage += aurEff->GetDamage() * int32(ticks - aurEff->GetTickNumber());
|
||||
|
||||
damage /= ticks;
|
||||
damage /= int32(ticks);
|
||||
|
||||
caster->CastCustomSpell(target, SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC, &damage, NULL, NULL, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user