[11000] Minor code style changes for readability in aggro related unit functions

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2011-01-11 15:02:40 +01:00
parent e9fc7d05b2
commit d38539f12a
2 changed files with 28 additions and 21 deletions

View file

@ -8501,6 +8501,7 @@ void Unit::SetDeathState(DeathState s)
######## AGGRO SYSTEM ########
######## ########
########################################*/
bool Unit::CanHaveThreatList() const
{
// only creatures can have threat list
@ -8562,6 +8563,7 @@ void Unit::DeleteThreatList()
{
if (CanHaveThreatList() && !m_ThreatManager.isThreatListEmpty())
SendThreatClear();
m_ThreatManager.clearReferences();
}
@ -8578,10 +8580,12 @@ void Unit::TauntApply(Unit* taunter)
return;
Unit *target = getVictim();
if (target && target == taunter)
return;
SetInFront(taunter);
if (((Creature*)this)->AI())
((Creature*)this)->AI()->AttackStart(taunter);
@ -8601,6 +8605,7 @@ void Unit::TauntFadeOut(Unit *taunter)
return;
Unit *target = getVictim();
if (!target || target != taunter)
return;
@ -8621,6 +8626,7 @@ void Unit::TauntFadeOut(Unit *taunter)
if (target && target != taunter)
{
SetInFront(target);
if (((Creature*)this)->AI())
((Creature*)this)->AI()->AttackStart(target);
}
@ -8638,6 +8644,7 @@ bool Unit::SelectHostileTarget()
if (!this->isAlive())
return false;
//This function only useful once AI has been initialized
if (!((Creature*)this)->AI())
return false;
@ -8663,8 +8670,8 @@ bool Unit::SelectHostileTarget()
do
{
--aura;
if ( (caster = (*aura)->GetCaster()) &&
caster->IsInMap(this) && caster->isTargetableForAttack() && caster->isInAccessablePlaceFor((Creature*)this) )
if ((caster = (*aura)->GetCaster()) && caster->IsInMap(this) &&
caster->isTargetableForAttack() && caster->isInAccessablePlaceFor((Creature*)this))
{
target = caster;
break;
@ -8673,8 +8680,8 @@ bool Unit::SelectHostileTarget()
}
}
// No taunt aura or taunt aura caster is dead, standard target selection
if (!target && !m_ThreatManager.isThreatListEmpty())
// No taunt aura or taunt aura caster is dead standart target selection
target = m_ThreatManager.getHostileTarget();
if (target)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10999"
#define REVISION_NR "11000"
#endif // __REVISION_NR_H__