Core/Unit: make neutral guards attack players involved in PvP

Fix https://github.com/TrinityCore/TrinityCore/issues/17635
This commit is contained in:
Léo Gautheron authored and Aokromes committed 2017-12-17 15:37:37 +01:00
1 parent 4283252731
commit bdf2d697fa
1 file changed
+3
+3
View File
@@ -8430,6 +8430,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->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP))
return true;
if (FactionTemplateEntry const* factionTemplate = creature->GetFactionTemplateEntry())
{
if (!(player->GetReputationMgr().GetForcedRankIfAny(factionTemplate)))