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)
This commit is contained in:
hondacrx
2021-06-23 23:37:42 -04:00
parent d485bf97ec
commit 545dcd4f7a
+2 -12
View File
@@ -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