[8571] Avoid use ^ bitmask operation for bool values compare in general.

Also drop HandleSet32Bit logn unused and wrong coded chat command code.
This commit is contained in:
VladimirMangos 2009-09-30 19:30:18 +04:00
parent b2e32f4ff9
commit 47bf1dbce6
10 changed files with 10 additions and 37 deletions

View file

@ -4067,9 +4067,9 @@ void Unit::RemoveArenaAuras(bool onleave)
for(AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end();)
{
if ( !(iter->second->GetSpellProto()->AttributesEx4 & (1<<21)) // don't remove stances, shadowform, pally/hunter auras
&& !iter->second->IsPassive() // don't remove passive auras
&& !iter->second->IsPassive() // don't remove passive auras
&& (!(iter->second->GetSpellProto()->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) || !(iter->second->GetSpellProto()->Attributes & SPELL_ATTR_UNK8)) // not unaffected by invulnerability auras or not having that unknown flag (that seemed the most probable)
&& (iter->second->IsPositive() ^ onleave)) // remove positive buffs on enter, negative buffs on leave
&& (iter->second->IsPositive() != onleave)) // remove positive buffs on enter, negative buffs on leave
RemoveAura(iter);
else
++iter;
@ -9398,7 +9398,7 @@ bool Unit::isTargetableForAttack(bool inverseAlive /*=false*/) const
if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
return false;
if (!(isAlive() ^ inverseAlive))
if (!(isAlive() != inverseAlive))
return false;
return IsInWorld() && !hasUnitState(UNIT_STAT_DIED)&& !isInFlight() /*&& !isStealth()*/;