From 545dcd4f7a1047810afde0554e2f8356a7301638 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 23 Jun 2021 23:37:42 -0400 Subject: [PATCH] Core/Combat: Unify combat permitted checks between CvC and PvC - only require "not friendly" in all cases. Fixes Yogg-Saron encounter. Port From (https://github.com/TrinityCore/TrinityCore/commit/f982f3019a1a12bdd9d85e59faf5ddb53c10761f) --- Source/Game/Combat/CombatManager.cs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Source/Game/Combat/CombatManager.cs b/Source/Game/Combat/CombatManager.cs index 1ad078a1e..e8abb56ce 100644 --- a/Source/Game/Combat/CombatManager.cs +++ b/Source/Game/Combat/CombatManager.cs @@ -56,18 +56,8 @@ namespace Game.Combat return false; if (a.HasUnitState(UnitState.InFlight) || b.HasUnitState(UnitState.InFlight)) return false; - if (a.IsControlledByPlayer() || b.IsControlledByPlayer()) - { - // PvSomething, only block friendly fire - if (a.IsFriendlyTo(b) || b.IsFriendlyTo(a)) - return false; - } - else - { - // CvC, need hostile reaction to start a fight - if (!a.IsHostileTo(b) && !b.IsHostileTo(a)) - return false; - } + if (a.IsFriendlyTo(b) || b.IsFriendlyTo(a)) + return false; Player playerA = a.GetCharmerOrOwnerPlayerOrPlayerItself(); Player playerB = b.GetCharmerOrOwnerPlayerOrPlayerItself(); // ...neither of the two units must be (owned by) a player with .gm on