Buildsystem/MSVC: Warning fixes

C4800 'type' : forcing value to bool 'true' or 'false' (performance warning)
C4127 conditional expression is constant
This commit is contained in:
Shauren committed 2014-07-17 15:42:57 +02:00
1 parent 345bed25d2
commit 7532864264
104 files changed
+386 -387

No files matched your search

+6 -6
View File
@@ -364,7 +364,7 @@ void Unit::Update(uint32 p_time)
bool Unit::haveOffhandWeapon() const
{
if (Player const* player = ToPlayer())
return player->GetWeaponForAttack(OFF_ATTACK, true);
return player->GetWeaponForAttack(OFF_ATTACK, true) != nullptr;
return CanDualWield();
}
@@ -2352,7 +2352,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo
bool canDodge = true;
bool canParry = true;
bool canBlock = spellInfo->AttributesEx3 & SPELL_ATTR3_BLOCKABLE_SPELL;
bool canBlock = (spellInfo->AttributesEx3 & SPELL_ATTR3_BLOCKABLE_SPELL) != 0;
// Same spells cannot be parry/dodge
if (spellInfo->Attributes & SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK)
@@ -3778,7 +3778,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit*
}
}
bool stealCharge = aura->GetSpellInfo()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES;
bool stealCharge = (aura->GetSpellInfo()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES) != 0;
// Cast duration to unsigned to prevent permanent aura's such as Righteous Fury being permanently added to caster
uint32 dur = std::min(2u * MINUTE * IN_MILLISECONDS, uint32(aura->GetDuration()));
@@ -4298,7 +4298,7 @@ void Unit::GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelCharges
// The charges / stack amounts don't count towards the total number of auras that can be dispelled.
// Ie: A dispel on a target with 5 stacks of Winters Chill and a Polymorph has 1 / (1 + 1) -> 50% chance to dispell
// Polymorph instead of 1 / (5 + 1) -> 16%.
bool dispel_charges = aura->GetSpellInfo()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES;
bool dispel_charges = (aura->GetSpellInfo()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES) != 0;
uint8 charges = dispel_charges ? aura->GetCharges() : aura->GetStackAmount();
if (charges > 0)
dispelList.push_back(std::make_pair(aura, charges));
@@ -7534,7 +7534,7 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp
CastSpell(this, 28682, true);
return (procEx & PROC_EX_CRITICAL_HIT);
return (procEx & PROC_EX_CRITICAL_HIT) != 0;
}
// Empowered Fire
case 31656:
@@ -15214,7 +15214,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
if (group)
{
group->BroadcastPacket(&data, group->GetMemberGroup(player->GetGUID()));
group->BroadcastPacket(&data, group->GetMemberGroup(player->GetGUID()) != 0);
if (creature)
{