feat(Core/Spells): improve SpellCheckRange(), spell cast when dismounting, falling or levitating spells (#3384)

This commit is contained in:
Stefano Borzì
2021-03-26 15:56:35 +01:00
committed by GitHub
parent 5a770d2945
commit b424273574
3 changed files with 127 additions and 53 deletions

View File

@@ -607,15 +607,19 @@ void MotionMaster::MoveFall(uint32 id /*=0*/, bool addFlagForNPC)
// Abort too if the ground is very near
if (fabs(_owner->GetPositionZ() - tz) < 0.1f)
{
return;
}
_owner->AddUnitMovementFlag(MOVEMENTFLAG_FALLING);
_owner->m_movementInfo.SetFallTime(0);
// don't run spline movement for players
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
_owner->AddUnitMovementFlag(MOVEMENTFLAG_FALLING);
_owner->m_movementInfo.SetFallTime(0);
_owner->ToPlayer()->SetFallInformation(time(nullptr), _owner->GetPositionZ());
return;
}
else if (_owner->GetTypeId() == TYPEID_UNIT && addFlagForNPC) // pussywizard
if (_owner->GetTypeId() == TYPEID_UNIT && addFlagForNPC) // pussywizard
{
_owner->RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING);
_owner->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY);