mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
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
(cherry picked from commit c826ec0a3c)
This commit is contained in:
@@ -152,8 +152,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);
|
||||
@@ -371,7 +370,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))
|
||||
|
||||
Reference in New Issue
Block a user