Core/Pets: Fix stay command if pet is currently processing spline movement

This commit is contained in:
Machiavelli
2012-02-21 10:41:48 +01:00
parent fb39566f1f
commit 1aceab6b62
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -17400,7 +17400,11 @@ bool CharmInfo::IsCommandAttack()
void CharmInfo::SaveStayPosition()
{
m_unit->GetPosition(m_stayX, m_stayY, m_stayZ);
//! At this point a new spline destination is enabled because of Unit::StopMoving()
G3D::Vector3 const stayPos = m_unit->movespline->FinalDestination();
m_stayX = stayPos.x;
m_stayY = stayPos.y;
m_stayZ = stayPos.z;
}
void CharmInfo::GetStayPosition(float &x, float &y, float &z)
+1
View File
@@ -155,6 +155,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
case COMMAND_STAY: //flat=1792 //STAY
pet->AttackStop();
pet->InterruptNonMeleeSpells(false);
StopMoving();
pet->GetMotionMaster()->Clear(false);
pet->GetMotionMaster()->MoveIdle();
charmInfo->SetCommandState(COMMAND_STAY);