Core/Handlers: apply some movement related corrections

Unit::StopMoving() is evil, and so is MotionMaster::Clear()

the first can really mess up existing movement generators
the second can interrupt "controlled" movements... can do it literally mid-air
This commit is contained in:
ccrs
2019-05-19 11:58:03 +02:00
parent 48208b8dde
commit c826ec0a3c

View File

@@ -159,8 +159,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
switch (spellid)
{
case COMMAND_STAY: // flat = 1792 - STAY
pet->StopMoving();
pet->GetMotionMaster()->Clear();
pet->GetMotionMaster()->Clear(MOTION_PRIORITY_NORMAL);
pet->GetMotionMaster()->MoveIdle();
charmInfo->SetCommandState(COMMAND_STAY);
@@ -366,7 +365,6 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
// This is true if pet has no target or has target but targets differs.
if (pet->GetVictim() != unit_target)
{
pet->GetMotionMaster()->Clear();
if (CreatureAI* AI = pet->ToCreature()->AI())
{
if (PetAI* petAI = dynamic_cast<PetAI*>(AI))