diff --git a/Source/Game/Globals/ObjectManager.cs b/Source/Game/Globals/ObjectManager.cs index b79c4fbd9..03288a31a 100644 --- a/Source/Game/Globals/ObjectManager.cs +++ b/Source/Game/Globals/ObjectManager.cs @@ -3677,6 +3677,15 @@ namespace Game } } + if (data.unit_flags.HasValue) + { + if ((data.unit_flags2.Value & (uint)UnitFlags2.FeignDeath) != 0 && (data.unit_flags.Value & (uint)(UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc)) == 0) + { + Log.outError(LogFilter.Sql, $"Table `creature` has creature (GUID: {guid} Entry: {data.Id}) has UNIT_FLAG2_FEIGN_DEATH set without IMMUNE_TO_PC | IMMUNE_TO_NPC, removing incorrect flag."); + data.unit_flags2 = data.unit_flags2 & ~(uint)UnitFlags2.FeignDeath; + } + } + if (data.unit_flags3.HasValue) { uint disallowedUnitFlags3 = (data.unit_flags3.Value & ~(uint)UnitFlags3.Allowed); @@ -3687,6 +3696,15 @@ namespace Game } } + if (data.unit_flags.HasValue) + { + if ((data.unit_flags3.Value & (uint)UnitFlags3.FakeDead) != 0 && (data.unit_flags.Value & (uint)(UnitFlags.ImmuneToPc | UnitFlags.ImmuneToNpc)) == 0) + { + Log.outError(LogFilter.Sql, $"Table `creature` has creature (GUID: {guid} Entry: {data.Id}) has UNIT_FLAG3_FAKE_DEAD set without IMMUNE_TO_PC | IMMUNE_TO_NPC, removing incorrect flag."); + data.unit_flags3 = data.unit_flags3 & ~(uint)UnitFlags3.FakeDead; + } + } + uint healthPct = Math.Clamp(data.curHealthPct, 1, 100); if (data.curHealthPct != healthPct) {