Skip to content

Commit

Permalink
Creature: Adjust updateentry overwriting some critical unit flags
Browse files Browse the repository at this point in the history
Closes #480
  • Loading branch information
killerwife committed Nov 14, 2023
1 parent b0343ae commit 49f511f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/game/Entities/Creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 49f511f

Please sign in to comment.