diff options
author | ModoX <moardox@gmail.com> | 2024-10-18 11:18:56 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-10-19 13:34:02 +0200 |
commit | a7e1de284ea90b2f3c233971906480849c2b97e6 (patch) | |
tree | 62ddbba572e6115478c6d528b267eb123ddb55ff /src/server/game/Globals | |
parent | b365a3171ef6f41b06c461021944ddc2939a79c7 (diff) |
Core/Creature: Remove UNIT_FLAG3_FAKE_DEAD and UNIT_FLAG2_FEIGN_DEATH if no unit_flags are set
* d66f2dcdac2f1602f36cd9f1720fdbf274a37c61 followup
(cherry picked from commit 72d952db74d0c4a6e90d7a387774d090eb4a842b)
Diffstat (limited to 'src/server/game/Globals')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 63d9403a77e..e47df9e3100 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2376,13 +2376,10 @@ void ObjectMgr::LoadCreatures() *data.unit_flags2 &= UNIT_FLAG2_ALLOWED; } - if (data.unit_flags.has_value()) + if (*data.unit_flags2 & UNIT_FLAG2_FEIGN_DEATH && (!data.unit_flags.has_value() || !(*data.unit_flags & (UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC)))) { - 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; - } + 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; } } @@ -2394,13 +2391,10 @@ void ObjectMgr::LoadCreatures() *data.unit_flags3 &= UNIT_FLAG3_ALLOWED; } - if (data.unit_flags.has_value()) + if (*data.unit_flags3 & UNIT_FLAG3_FAKE_DEAD && (!data.unit_flags.has_value() || !(*data.unit_flags & (UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC)))) { - 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; - } + 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; } } |