@@ -2007,8 +2007,8 @@ void Creature::setDeathState(DeathState s)
20072007 m_formation->FormationReset (true );
20082008
20092009 bool needsFalling = (IsFlying () || IsHovering ()) && !IsUnderWater ();
2010- SetHover (false , false );
2011- SetDisableGravity (false , false );
2010+ SetHover (false );
2011+ SetDisableGravity (false );
20122012
20132013 if (needsFalling)
20142014 GetMotionMaster ()->MoveFall ();
@@ -2932,124 +2932,6 @@ void Creature::SetCannotReachTarget(bool cannotReach)
29322932 TC_LOG_DEBUG (" entities.unit.chase" , " Creature::SetCannotReachTarget() called with true. Details: {}" , GetDebugInfo ());
29332933}
29342934
2935- bool Creature::SetWalk (bool enable)
2936- {
2937- if (!Unit::SetWalk (enable))
2938- return false ;
2939-
2940- WorldPacket data (enable ? SMSG_SPLINE_MOVE_SET_WALK_MODE : SMSG_SPLINE_MOVE_SET_RUN_MODE, 9 );
2941- data << GetPackGUID ();
2942- SendMessageToSet (&data, false );
2943- return true ;
2944- }
2945-
2946- bool Creature::SetDisableGravity (bool disable, bool packetOnly /* =false*/ , bool updateAnimTier /* = true*/ )
2947- {
2948- // ! It's possible only a packet is sent but moveflags are not updated
2949- // ! Need more research on this
2950- if (!packetOnly && !Unit::SetDisableGravity (disable, packetOnly, updateAnimTier))
2951- return false ;
2952-
2953- if (updateAnimTier && IsAlive () && !HasUnitState (UNIT_STATE_ROOT) && !GetMovementTemplate ().IsRooted ())
2954- {
2955- if (IsGravityDisabled ())
2956- SetAnimTier (AnimTier::Fly);
2957- else if (IsHovering ())
2958- SetAnimTier (AnimTier::Hover);
2959- else
2960- SetAnimTier (AnimTier::Ground);
2961- }
2962-
2963- if (!movespline->Initialized ())
2964- return true ;
2965-
2966- WorldPacket data (disable ? SMSG_SPLINE_MOVE_GRAVITY_DISABLE : SMSG_SPLINE_MOVE_GRAVITY_ENABLE, 9 );
2967- data << GetPackGUID ();
2968- SendMessageToSet (&data, false );
2969- return true ;
2970- }
2971-
2972- bool Creature::SetSwim (bool enable)
2973- {
2974- if (!Unit::SetSwim (enable))
2975- return false ;
2976-
2977- if (!movespline->Initialized ())
2978- return true ;
2979-
2980- WorldPacket data (enable ? SMSG_SPLINE_MOVE_START_SWIM : SMSG_SPLINE_MOVE_STOP_SWIM);
2981- data << GetPackGUID ();
2982- SendMessageToSet (&data, true );
2983- return true ;
2984- }
2985-
2986- bool Creature::SetCanFly (bool enable, bool /* packetOnly = false */ )
2987- {
2988- if (!Unit::SetCanFly (enable))
2989- return false ;
2990-
2991- if (!movespline->Initialized ())
2992- return true ;
2993-
2994- WorldPacket data (enable ? SMSG_SPLINE_MOVE_SET_FLYING : SMSG_SPLINE_MOVE_UNSET_FLYING, 9 );
2995- data << GetPackGUID ();
2996- SendMessageToSet (&data, false );
2997- return true ;
2998- }
2999-
3000- bool Creature::SetWaterWalking (bool enable, bool packetOnly /* = false */ )
3001- {
3002- if (!packetOnly && !Unit::SetWaterWalking (enable))
3003- return false ;
3004-
3005- if (!movespline->Initialized ())
3006- return true ;
3007-
3008- WorldPacket data (enable ? SMSG_SPLINE_MOVE_WATER_WALK : SMSG_SPLINE_MOVE_LAND_WALK);
3009- data << GetPackGUID ();
3010- SendMessageToSet (&data, true );
3011- return true ;
3012- }
3013-
3014- bool Creature::SetFeatherFall (bool enable, bool packetOnly /* = false */ )
3015- {
3016- if (!packetOnly && !Unit::SetFeatherFall (enable))
3017- return false ;
3018-
3019- if (!movespline->Initialized ())
3020- return true ;
3021-
3022- WorldPacket data (enable ? SMSG_SPLINE_MOVE_FEATHER_FALL : SMSG_SPLINE_MOVE_NORMAL_FALL);
3023- data << GetPackGUID ();
3024- SendMessageToSet (&data, true );
3025- return true ;
3026- }
3027-
3028- bool Creature::SetHover (bool enable, bool packetOnly /* = false*/ , bool updateAnimTier /* = true*/ )
3029- {
3030- if (!packetOnly && !Unit::SetHover (enable, packetOnly, updateAnimTier))
3031- return false ;
3032-
3033- if (updateAnimTier && IsAlive () && !HasUnitState (UNIT_STATE_ROOT) && !GetMovementTemplate ().IsRooted ())
3034- {
3035- if (IsGravityDisabled ())
3036- SetAnimTier (AnimTier::Fly);
3037- else if (IsHovering ())
3038- SetAnimTier (AnimTier::Hover);
3039- else
3040- SetAnimTier (AnimTier::Ground);
3041- }
3042-
3043- if (!movespline->Initialized ())
3044- return true ;
3045-
3046- // ! Not always a packet is sent
3047- WorldPacket data (enable ? SMSG_SPLINE_MOVE_SET_HOVER : SMSG_SPLINE_MOVE_UNSET_HOVER, 9 );
3048- data << GetPackGUID ();
3049- SendMessageToSet (&data, false );
3050- return true ;
3051- }
3052-
30532935float Creature::GetAggroRange (Unit const * target) const
30542936{
30552937 // Determines the aggro range for creatures (usually pets), used mainly for aggressive pet target selection.
0 commit comments