From c826ec0a3c17f86f8a3e44455c533fb46f239720 Mon Sep 17 00:00:00 2001 From: ccrs Date: Sun, 19 May 2019 11:58:03 +0200 Subject: 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 --- src/server/game/Handlers/PetHandler.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 0bc5d5006e7..dca55bf98ee 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -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(AI)) -- cgit v1.2.3