Build/Clang: fixed 96 warnings + improved code readability

This commit is contained in:
ShinDarth
2016-08-16 23:21:38 +02:00
parent 9802678689
commit a4589f71d5
29 changed files with 134 additions and 63 deletions

View File

@@ -3379,13 +3379,16 @@ bool Unit::isInAccessiblePlaceFor(Creature const* c) const
else if (c->GetMapId() == 631) // Icecrown Citadel
{
// if static transport doesn't match - return false
if (c->GetTransport() != this->GetTransport() && (c->GetTransport() && c->GetTransport()->IsStaticTransport() || this->GetTransport() && this->GetTransport()->IsStaticTransport()))
if (c->GetTransport() != this->GetTransport() &&
((c->GetTransport() && c->GetTransport()->IsStaticTransport()) ||
(this->GetTransport() && this->GetTransport()->IsStaticTransport())))
return false;
// special handling for ICC (map 631), for non-flying pets in Gunship Battle, for trash npcs this is done via CanAIAttack
if (IS_PLAYER_GUID(c->GetOwnerGUID()) && !c->CanFly())
{
if (c->GetTransport() && !this->GetTransport() || !c->GetTransport() && this->GetTransport())
if ((c->GetTransport() && !this->GetTransport()) ||
(!c->GetTransport() && this->GetTransport()))
return false;
if (this->GetTransport())
{
@@ -3670,7 +3673,7 @@ void Unit::HandleSafeUnitPointersOnDelete(Unit* thisUnit)
bool Unit::IsInWater(bool allowAbove) const
{
const_cast<Unit*>(this)->UpdateEnvironmentIfNeeded(1);
return m_last_isinwater_status || allowAbove && m_last_islittleabovewater_status;
return m_last_isinwater_status || (allowAbove && m_last_islittleabovewater_status);
}
bool Unit::IsUnderWater() const
@@ -10385,7 +10388,8 @@ float Unit::SpellPctDamageModsDone(Unit* victim, SpellInfo const* spellProto, Da
// Merciless Combat
if ((*i)->GetSpellInfo()->SpellIconID == 2656)
{
if( spellProto && spellProto->SpellFamilyFlags[0] & 0x2 || spellProto->SpellFamilyFlags[1] & 0x2 )
if (spellProto &&
((spellProto->SpellFamilyFlags[0] & 0x2) || (spellProto->SpellFamilyFlags[1] & 0x2)))
if (!victim->HealthAbovePct(35))
AddPct(DoneTotalMod, (*i)->GetAmount());
}