diff options
| author | ccrs <ccrs@users.noreply.github.com> | 2025-10-25 16:59:32 +0200 |
|---|---|---|
| committer | ccrs <ccrs@users.noreply.github.com> | 2025-10-25 16:59:32 +0200 |
| commit | 736add62678b5e04399421ee6ebcdaa2c7447712 (patch) | |
| tree | ea81120b010e8f4284b7f6deed1a20790a96a23e | |
| parent | 4c27329beddb2eba59917c735912de3dcea2665b (diff) | |
Core/Creature: cleanup movementflags initialization on creature create, a bit
- InitializeMovementFlags after creature addon loading (auras, etc)
- Remove redundant m_positionZ alteration (relocation is already handled in Unit::SetHover)
- Remove additional AddUnitMovementFlag (already handled in InitializeMovementFlags if necessary)
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index febf272ad4f..0cfa85c237b 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -628,9 +628,8 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/, SetIsCombatDisallowed((cInfo->flags_extra & CREATURE_FLAG_EXTRA_CANNOT_ENTER_COMBAT) != 0); LoadTemplateRoot(); - InitializeMovementFlags(); - LoadCreaturesAddon(); + InitializeMovementFlags(); LoadTemplateImmunities(); GetThreatManager().EvaluateSuppressed(); @@ -1097,9 +1096,6 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 phaseMask, u break; } - //! Need to be called after LoadCreaturesAddon - MOVEMENTFLAG_HOVER is set there - m_positionZ += GetHoverOffset(); - LastUsedScriptID = GetScriptId(); if (IsSpiritHealer() || IsSpiritGuide() || (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_GHOST_VISIBILITY)) @@ -2538,14 +2534,6 @@ bool Creature::LoadCreaturesAddon() SetAnimTier(AnimTier(creatureAddon->animTier)); ReplaceAllVisFlags(UnitVisFlags(creatureAddon->visFlags)); - //! Suspected correlation between UNIT_FIELD_BYTES_1, offset 3, value 0x2: - //! If no inhabittype_fly (if no MovementFlag_DisableGravity or MovementFlag_CanFly flag found in sniffs) - //! Check using InhabitType as movement flags are assigned dynamically - //! basing on whether the creature is in air or not - //! Set MovementFlag_Hover. Otherwise do nothing. - if (CanHover()) - AddUnitMovementFlag(MOVEMENTFLAG_HOVER); - // UNIT_FIELD_BYTES_2 values SetSheath(SheathState(creatureAddon->sheathState)); ReplaceAllPvpFlags(UnitPVPStateFlags(creatureAddon->pvpFlags)); |
