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
+10 -3
View File
@@ -1617,9 +1617,16 @@ namespace Framework.Constants
public enum PhaseEntryFlags : ushort
{
Normal = 0x08,
Cosmetic = 0x10,
Personal = 0x20
ReadOnly = 0x001,
InternalPhase = 0x002,
Normal = 0x008,
Cosmetic = 0x010,
Personal = 0x020,
Expensive = 0x040,
EventsAreObservable = 0x080,
UsesPreloadConditions = 0x100,
UnshareablePersonal = 0x200,
ObjectsAreVisible = 0x400,
}
// PhaseUseFlags fields in different db2s
+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))