mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Unit: make neutral guards attack players involved in PvP
Fix https://github.com/TrinityCore/TrinityCore/issues/17635
(cherry picked from commit e96cf0b242)
This commit is contained in:
@@ -8421,6 +8421,9 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
|
||||
Player const* player = playerAffectingAttacker ? playerAffectingAttacker : playerAffectingTarget;
|
||||
Unit const* creature = playerAffectingAttacker ? target : this;
|
||||
|
||||
if (creature->IsContestedGuard() && player->HasPlayerFlag(PLAYER_FLAGS_CONTESTED_PVP))
|
||||
return true;
|
||||
|
||||
if (FactionTemplateEntry const* factionTemplate = creature->GetFactionTemplateEntry())
|
||||
{
|
||||
if (!(player->GetReputationMgr().GetForcedRankIfAny(factionTemplate)))
|
||||
|
||||
Reference in New Issue
Block a user