Implemented GetPhaseByAuras removing redundant code (DRY)
This commit is contained in:
parent
bc726a2f16
commit
3e9ffa3e33
4 changed files with 19 additions and 23 deletions
|
|
@ -17556,6 +17556,17 @@ float Unit::MeleeSpellMissChance(const Unit* victim, WeaponAttackType attType, i
|
|||
return missChance;
|
||||
}
|
||||
|
||||
uint32 Unit::GetPhaseByAuras() const
|
||||
{
|
||||
uint32 currentPhase = 0;
|
||||
AuraEffectList const& phases = GetAuraEffectsByType(SPELL_AURA_PHASE);
|
||||
if (!phases.empty())
|
||||
for (AuraEffectList::const_iterator itr = phases.begin(); itr != phases.end(); ++itr)
|
||||
currentPhase |= (*itr)->GetMiscValue();
|
||||
|
||||
return currentPhase;
|
||||
}
|
||||
|
||||
void Unit::SetPhaseMask(uint32 newPhaseMask, bool update)
|
||||
{
|
||||
if (newPhaseMask == GetPhaseMask())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue