Core/Phasing: Fixed inverse phaseshift logic

Port From (https://github.com/TrinityCore/TrinityCore/commit/630adfec227c18b8825f4871a1bf1a395b8dee05)
This commit is contained in:
hondacrx
2021-11-23 21:41:27 -05:00
parent dab1702214
commit 919d547ceb
2 changed files with 15 additions and 8 deletions
+5 -5
View File
@@ -166,8 +166,8 @@ namespace Game
var checkInversePhaseShift = new Func<PhaseShift, PhaseShift, bool>((phaseShift, excludedPhaseShift) =>
{
if (phaseShift.Flags.HasFlag(PhaseShiftFlags.Unphased) && !excludedPhaseShift.Flags.HasFlag(PhaseShiftFlags.InverseUnphased))
return true;
if (phaseShift.Flags.HasFlag(PhaseShiftFlags.Unphased) && excludedPhaseShift.Flags.HasFlag(PhaseShiftFlags.InverseUnphased))
return false;
foreach (var pair in phaseShift.Phases)
{
@@ -175,11 +175,11 @@ namespace Game
continue;
var ExcludedPhaseRef = excludedPhaseShift.Phases.LookupByKey(pair.Key);
if (ExcludedPhaseRef == null || ExcludedPhaseRef.Flags.HasAnyFlag(excludePhasesWithFlag))
return true;
if (ExcludedPhaseRef != null || !ExcludedPhaseRef.Flags.HasAnyFlag(excludePhasesWithFlag))
return false;
}
return false;
return true;
});
if (other.Flags.HasFlag(PhaseShiftFlags.Inverse))