diff options
author | ModoX <moardox@gmail.com> | 2024-08-31 19:43:18 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-09-03 19:54:40 +0200 |
commit | 1c2829e615a5d33f1e32e76b00940291a0fb32a2 (patch) | |
tree | ccdccadf256fcc8f0d59c6160caebfd3f7d06772 /src | |
parent | 403142829a286d76c050dcc9efa562a34d4af593 (diff) |
Core/Creature: Added additional checks when setting feign death in db
(cherry picked from commit d66f2dcdac2f1602f36cd9f1720fdbf274a37c61)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index dd16bfe6839..f9a4c0cc290 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2375,6 +2375,15 @@ void ObjectMgr::LoadCreatures() TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: {} Entry: {}) with disallowed `unit_flags2` {}, removing incorrect flag.", guid, data.id, disallowedUnitFlags2); *data.unit_flags2 &= UNIT_FLAG2_ALLOWED; } + + if (data.unit_flags.has_value()) + { + if (*data.unit_flags2 & UNIT_FLAG2_FEIGN_DEATH && !(*data.unit_flags & (UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC))) + { + TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: {} Entry: {}) has UNIT_FLAG2_FEIGN_DEATH set without IMMUNE_TO_PC | IMMUNE_TO_NPC, removing incorrect flag.", guid, data.id); + *data.unit_flags2 &= ~UNIT_FLAG2_FEIGN_DEATH; + } + } } if (data.unit_flags3.has_value()) @@ -2384,6 +2393,15 @@ void ObjectMgr::LoadCreatures() TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: {} Entry: {}) with disallowed `unit_flags3` {}, removing incorrect flag.", guid, data.id, disallowedUnitFlags3); *data.unit_flags3 &= UNIT_FLAG3_ALLOWED; } + + if (data.unit_flags.has_value()) + { + if (*data.unit_flags3 & UNIT_FLAG3_FAKE_DEAD && !(*data.unit_flags & (UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC))) + { + TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: {} Entry: {}) has UNIT_FLAG3_FAKE_DEAD set without IMMUNE_TO_PC | IMMUNE_TO_NPC, removing incorrect flag.", guid, data.id); + *data.unit_flags3 &= ~UNIT_FLAG3_FAKE_DEAD; + } + } } uint32 healthPct = std::clamp<uint32>(data.curHealthPct, 1, 100); |