Core/Spells: Fix some -Wconversion warnings

Attempt to fix #13152 by properly casting between data types during damage calculations.
This commit is contained in:
Unholychick
2014-09-16 23:56:05 +02:00
parent 2a262aad21
commit 6477e96cca
2 changed files with 5 additions and 5 deletions

View File

@@ -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;

View File

@@ -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);
}