Skip to content

Commit 736add6

Browse files
committed
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)
1 parent 4c27329 commit 736add6

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

src/server/game/Entities/Creature/Creature.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -628,9 +628,8 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/,
628628
SetIsCombatDisallowed((cInfo->flags_extra & CREATURE_FLAG_EXTRA_CANNOT_ENTER_COMBAT) != 0);
629629

630630
LoadTemplateRoot();
631-
InitializeMovementFlags();
632-
633631
LoadCreaturesAddon();
632+
InitializeMovementFlags();
634633
LoadTemplateImmunities();
635634

636635
GetThreatManager().EvaluateSuppressed();
@@ -1097,9 +1096,6 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 phaseMask, u
10971096
break;
10981097
}
10991098

1100-
//! Need to be called after LoadCreaturesAddon - MOVEMENTFLAG_HOVER is set there
1101-
m_positionZ += GetHoverOffset();
1102-
11031099
LastUsedScriptID = GetScriptId();
11041100

11051101
if (IsSpiritHealer() || IsSpiritGuide() || (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_GHOST_VISIBILITY))
@@ -2538,14 +2534,6 @@ bool Creature::LoadCreaturesAddon()
25382534
SetAnimTier(AnimTier(creatureAddon->animTier));
25392535
ReplaceAllVisFlags(UnitVisFlags(creatureAddon->visFlags));
25402536

2541-
//! Suspected correlation between UNIT_FIELD_BYTES_1, offset 3, value 0x2:
2542-
//! If no inhabittype_fly (if no MovementFlag_DisableGravity or MovementFlag_CanFly flag found in sniffs)
2543-
//! Check using InhabitType as movement flags are assigned dynamically
2544-
//! basing on whether the creature is in air or not
2545-
//! Set MovementFlag_Hover. Otherwise do nothing.
2546-
if (CanHover())
2547-
AddUnitMovementFlag(MOVEMENTFLAG_HOVER);
2548-
25492537
// UNIT_FIELD_BYTES_2 values
25502538
SetSheath(SheathState(creatureAddon->sheathState));
25512539
ReplaceAllPvpFlags(UnitPVPStateFlags(creatureAddon->pvpFlags));

0 commit comments

Comments
 (0)