mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 01:29:07 +00:00
refactor(Cote/Unit): cleanup - part2 (#19821)
* fix(Core/AI): remove an unused variable * Move variables at the end of each sections * reorder several methods * remove few inline defintions * few codestyle fixes
This commit is contained in:
@@ -738,6 +738,20 @@ bool Unit::GetRandomContactPoint(Unit const* obj, float& x, float& y, float& z,
|
||||
return true;
|
||||
}
|
||||
|
||||
Unit* Unit::getAttackerForHelper() const
|
||||
{
|
||||
if (GetVictim() != nullptr)
|
||||
return GetVictim();
|
||||
|
||||
if (!IsEngaged())
|
||||
return nullptr;
|
||||
|
||||
if (!m_attackers.empty())
|
||||
return *(m_attackers.begin());
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Unit::UpdateInterruptMask()
|
||||
{
|
||||
m_interruptMask = 0;
|
||||
@@ -17222,6 +17236,17 @@ void Unit::SetContestedPvP(Player* attackedPlayer, bool lookForNearContestedGuar
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::SetCantProc(bool apply)
|
||||
{
|
||||
if (apply)
|
||||
++m_procDeep;
|
||||
else
|
||||
{
|
||||
ASSERT(m_procDeep);
|
||||
--m_procDeep;
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::AddPetAura(PetAura const* petSpell)
|
||||
{
|
||||
if (!IsPlayer())
|
||||
|
||||
Reference in New Issue
Block a user