Fix an overly strict check that was causing guardians to evade loop. Also make players properly enter combat when their pets are engaged by a creature.
This commit is contained in:
1 parent
4326455788
commit
af36d491a1
2 files changed
+9
-2
No files matched your search
@@ -5425,7 +5425,7 @@ void Unit::_removeAttacker(Unit* pAttacker)
|
||||
Unit* Unit::getAttackerForHelper() const // If someone wants to help, who to give them
|
||||
{
|
||||
if (Unit* victim = GetVictim())
|
||||
if (!IsControlledByPlayer() || IsInCombatWith(victim) || victim->IsInCombatWith(this))
|
||||
if ((!IsPet() && !GetPlayerMovingMe()) || IsInCombatWith(victim) || victim->IsInCombatWith(this))
|
||||
return victim;
|
||||
|
||||
if (!m_attackers.empty())
|
||||
@@ -5532,6 +5532,14 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
victim->SetInCombatWith(this);
|
||||
|
||||
if (Unit* owner = victim->GetOwner())
|
||||
{
|
||||
AddThreat(owner, 0.0f);
|
||||
SetInCombatWith(owner);
|
||||
if (owner->GetTypeId() == TYPEID_PLAYER)
|
||||
owner->SetInCombatWith(this);
|
||||
}
|
||||
|
||||
creature->SendAIReaction(AI_REACTION_HOSTILE);
|
||||
creature->CallAssistance();
|
||||
|
||||
|
||||
Reference in new issue
Block a user