From 49f511f7f15e96bd5f40e983ab910eb82bd54941 Mon Sep 17 00:00:00 2001 From: killerwife Date: Wed, 15 Nov 2023 00:14:48 +0100 Subject: [PATCH] Creature: Adjust updateentry overwriting some critical unit flags Closes https://github.com/cmangos/mangos-wotlk/pull/480 --- src/game/Entities/Creature.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/game/Entities/Creature.cpp b/src/game/Entities/Creature.cpp index da0cabfefc6..1969df0b69f 100644 --- a/src/game/Entities/Creature.cpp +++ b/src/game/Entities/Creature.cpp @@ -571,8 +571,14 @@ bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data /*=nullptr*/, if (m_movementInfo.HasMovementFlag(MOVEFLAG_SWIMMING)) unitFlags |= UNIT_FLAG_SWIMMING; + uint32 unitFlags2 = GetCreatureInfo()->UnitFlags2; + if (HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH)) + unitFlags2 |= UNIT_FLAG2_FEIGN_DEATH; + if (HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_CLONED)) + unitFlags2 |= UNIT_FLAG2_CLONED; + SetUInt32Value(UNIT_FIELD_FLAGS, unitFlags); - SetUInt32Value(UNIT_FIELD_FLAGS_2, GetCreatureInfo()->UnitFlags2); + SetUInt32Value(UNIT_FIELD_FLAGS_2, unitFlags2); // preserve all current dynamic flags if exist uint32 dynFlags = GetUInt32Value(UNIT_DYNAMIC_FLAGS);