mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 23:26:23 +00:00
refactor(Core/Combat): Code style and improvement of ThreatMgr (#12992)
This commit is contained in:
@@ -207,8 +207,8 @@ bool TemporaryThreatModifierEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
||||
{
|
||||
if (m_owner.IsInCombatWith(victim))
|
||||
{
|
||||
m_owner.GetThreatMgr().modifyThreatPercent(victim, -100); // Reset threat to zero.
|
||||
m_owner.GetThreatMgr().addThreat(victim, m_threatValue); // Set to the previous value it had, first before modification.
|
||||
m_owner.GetThreatMgr().ModifyThreatByPercent(victim, -100); // Reset threat to zero.
|
||||
m_owner.GetThreatMgr().AddThreat(victim, m_threatValue); // Set to the previous value it had, first before modification.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -839,13 +839,13 @@ void Creature::Update(uint32 diff)
|
||||
}
|
||||
};
|
||||
|
||||
if (GetThreatMgr().getThreatList().size() <= 1)
|
||||
if (GetThreatMgr().GetThreatListSize() <= 1)
|
||||
{
|
||||
EnterEvade();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (HostileReference* ref = GetThreatMgr().getOnlineContainer().getReferenceByTarget(m_cannotReachTarget))
|
||||
if (HostileReference* ref = GetThreatMgr().GetOnlineContainer().getReferenceByTarget(m_cannotReachTarget))
|
||||
{
|
||||
ref->removeReference();
|
||||
SetCannotReachTarget();
|
||||
@@ -3626,11 +3626,11 @@ void Creature::ModifyThreatPercentTemp(Unit* victim, int32 percent, Milliseconds
|
||||
{
|
||||
if (victim)
|
||||
{
|
||||
float currentThreat = GetThreatMgr().getThreat(victim);
|
||||
float currentThreat = GetThreatMgr().GetThreat(victim);
|
||||
|
||||
if (percent != 0.0f)
|
||||
{
|
||||
GetThreatMgr().modifyThreatPercent(victim, percent);
|
||||
GetThreatMgr().ModifyThreatByPercent(victim, percent);
|
||||
}
|
||||
|
||||
TemporaryThreatModifierEvent* pEvent = new TemporaryThreatModifierEvent(*this, victim->GetGUID(), currentThreat);
|
||||
|
||||
Reference in New Issue
Block a user