Fix login

This commit is contained in:
Hondacrx
2024-11-16 23:05:45 -05:00
parent 76b0d747d3
commit 406aa5e445
26 changed files with 151 additions and 76 deletions
+10 -10
View File
@@ -3675,12 +3675,12 @@ namespace Game
Log.outError(LogFilter.Sql, $"Table `creature_template` lists creature (Entry: {cInfo.Entry}) with disallowed `unit_flags2` {disallowedUnitFlags2}, removing incorrect flag.");
data.unit_flags2 = data.unit_flags2 & (uint)UnitFlags2.Allowed;
}
}
if ((data.unit_flags2.Value & (uint)UnitFlags2.FeignDeath) != 0 && (!data.unit_flags.HasValue || (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_flags2.Value & (uint)UnitFlags2.FeignDeath) != 0 && (!data.unit_flags.HasValue || (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)
@@ -3691,12 +3691,12 @@ namespace Game
Log.outError(LogFilter.Sql, $"Table `creature_template` lists creature (Entry: {cInfo.Entry}) with disallowed `unit_flags3` {disallowedUnitFlags3}, removing incorrect flag.");
data.unit_flags3 = data.unit_flags3 & (uint)UnitFlags3.Allowed;
}
}
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;
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);