Core/Combat: Allow refresh pvp combat when assisting a unit that is in pvp combat (#26773)

(cherry picked from commit 372c84392b)
This commit is contained in:
Gildor
2021-08-08 13:18:08 +02:00
committed by Shauren
parent ec1c958d01
commit b6615a45eb

View File

@@ -236,14 +236,11 @@ void CombatManager::InheritCombatStatesFrom(Unit const* who)
}
for (auto& ref : mgr._pvpRefs)
{
if (!IsInCombatWith(ref.first))
{
Unit* target = ref.second->GetOther(who);
if ((_owner->IsImmuneToPC() && target->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED)) ||
(_owner->IsImmuneToNPC() && !target->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED)))
continue;
SetInCombatWith(target);
}
Unit* target = ref.second->GetOther(who);
if ((_owner->IsImmuneToPC() && target->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED)) ||
(_owner->IsImmuneToNPC() && !target->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED)))
continue;
SetInCombatWith(target);
}
}