Core/Handlers: apply some movement related corrections
Port From (https://github.com/TrinityCore/TrinityCore/commit/476566871879abe51a48833a01cec427dd7c6b8e)
This commit is contained in:
@@ -140,8 +140,7 @@ namespace Game
|
|||||||
switch ((CommandStates)spellid)
|
switch ((CommandStates)spellid)
|
||||||
{
|
{
|
||||||
case CommandStates.Stay: // flat = 1792 //STAY
|
case CommandStates.Stay: // flat = 1792 //STAY
|
||||||
pet.StopMoving();
|
pet.GetMotionMaster().Clear(MovementGeneratorPriority.Normal);
|
||||||
pet.GetMotionMaster().Clear();
|
|
||||||
pet.GetMotionMaster().MoveIdle();
|
pet.GetMotionMaster().MoveIdle();
|
||||||
charmInfo.SetCommandState(CommandStates.Stay);
|
charmInfo.SetCommandState(CommandStates.Stay);
|
||||||
|
|
||||||
@@ -183,7 +182,6 @@ namespace Game
|
|||||||
if (!owner.IsValidAttackTarget(TargetUnit))
|
if (!owner.IsValidAttackTarget(TargetUnit))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pet.ClearUnitState(UnitState.Follow);
|
|
||||||
// This is true if pet has no target or has target but targets differs.
|
// This is true if pet has no target or has target but targets differs.
|
||||||
if (pet.GetVictim() != TargetUnit || !pet.GetCharmInfo().IsCommandAttack())
|
if (pet.GetVictim() != TargetUnit || !pet.GetCharmInfo().IsCommandAttack())
|
||||||
{
|
{
|
||||||
@@ -367,7 +365,6 @@ namespace Game
|
|||||||
// This is true if pet has no target or has target but targets differs.
|
// This is true if pet has no target or has target but targets differs.
|
||||||
if (pet.GetVictim() != unit_target)
|
if (pet.GetVictim() != unit_target)
|
||||||
{
|
{
|
||||||
pet.GetMotionMaster().Clear();
|
|
||||||
CreatureAI ai = pet.ToCreature().GetAI();
|
CreatureAI ai = pet.ToCreature().GetAI();
|
||||||
if (ai != null)
|
if (ai != null)
|
||||||
{
|
{
|
||||||
@@ -686,7 +683,6 @@ namespace Game
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
SpellCastTargets targets = new(caster, petCastSpell.Cast);
|
SpellCastTargets targets = new(caster, petCastSpell.Cast);
|
||||||
caster.ClearUnitState(UnitState.Follow);
|
|
||||||
|
|
||||||
Spell spell = new(caster, spellInfo, TriggerCastFlags.None);
|
Spell spell = new(caster, spellInfo, TriggerCastFlags.None);
|
||||||
spell.m_fromClient = true;
|
spell.m_fromClient = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user