Core/Movement: Prevent IdleMovementGenerator being put into MOTION_SLOT_IDLE and MOTION_SLOT_ACTIVE simultaneously
This commit is contained in:
@@ -715,7 +715,7 @@ void Creature::Motion_Initialize()
|
||||
i_motionMaster.Initialize();
|
||||
}
|
||||
else if (m_formation->isFormed())
|
||||
i_motionMaster.MoveIdle(MOTION_SLOT_IDLE); //wait the order of leader
|
||||
i_motionMaster.MoveIdle(); //wait the order of leader
|
||||
else
|
||||
i_motionMaster.Initialize();
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ void CreatureGroup::FormationReset(bool dismiss)
|
||||
if (dismiss)
|
||||
itr->first->GetMotionMaster()->Initialize();
|
||||
else
|
||||
itr->first->GetMotionMaster()->MoveIdle(MOTION_SLOT_IDLE);
|
||||
itr->first->GetMotionMaster()->MoveIdle();
|
||||
sLog->outDebug(LOG_FILTER_UNITS, "Set %s movement for member GUID: %u", dismiss ? "default" : "idle", itr->first->GetGUIDLow());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,12 +175,11 @@ void MotionMaster::DelayedExpire()
|
||||
--i_top;
|
||||
}
|
||||
|
||||
void MotionMaster::MoveIdle(MovementSlot slot)
|
||||
void MotionMaster::MoveIdle()
|
||||
{
|
||||
//if (empty() || !isStatic(top()))
|
||||
// push(&si_idleMovement);
|
||||
if (!isStatic(Impl[slot]))
|
||||
Mutate(&si_idleMovement, slot);
|
||||
//! Should be preceded by MovementExpired or Clear if there's an overlying movementgenerator active
|
||||
if (empty() || !isStatic(top()))
|
||||
Mutate(&si_idleMovement, MOTION_SLOT_IDLE);
|
||||
}
|
||||
|
||||
void MotionMaster::MoveRandom(float spawndist)
|
||||
|
||||
@@ -142,7 +142,7 @@ class MotionMaster //: private std::stack<MovementGenerator *>
|
||||
DirectExpire(reset);
|
||||
}
|
||||
|
||||
void MoveIdle(MovementSlot slot = MOTION_SLOT_ACTIVE);
|
||||
void MoveIdle();
|
||||
void MoveTargetedHome();
|
||||
void MoveRandom(float spawndist = 0.0f);
|
||||
void MoveFollow(Unit* target, float dist, float angle, MovementSlot slot = MOTION_SLOT_ACTIVE);
|
||||
|
||||
@@ -155,6 +155,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
|
||||
case COMMAND_STAY: //flat=1792 //STAY
|
||||
pet->AttackStop();
|
||||
pet->InterruptNonMeleeSpells(false);
|
||||
pet->GetMotionMaster()->Clear(false);
|
||||
pet->GetMotionMaster()->MoveIdle();
|
||||
charmInfo->SetCommandState(COMMAND_STAY);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user