re-enable CreatureAI::MovementInform for Chase/FollowMovementGenerator - didn't realize any AI used this
Port From (https://github.com/TrinityCore/TrinityCore/commit/5f0f530c0859982bc2c0c230d928aa3fc8d86d23)
This commit is contained in:
@@ -16,13 +16,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
using Framework.Constants;
|
using Framework.Constants;
|
||||||
|
using Game.AI;
|
||||||
using Game.Entities;
|
using Game.Entities;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Framework.GameMath;
|
|
||||||
|
|
||||||
namespace Game.Movement
|
namespace Game.Movement
|
||||||
{
|
{
|
||||||
@@ -95,6 +91,7 @@ namespace Game.Movement
|
|||||||
_path = null;
|
_path = null;
|
||||||
owner.StopMoving();
|
owner.StopMoving();
|
||||||
owner.SetInFront(target);
|
owner.SetInFront(target);
|
||||||
|
DoMovementInform(owner, target);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -106,6 +103,7 @@ namespace Game.Movement
|
|||||||
_path = null;
|
_path = null;
|
||||||
owner.ClearUnitState(UnitState.ChaseMove);
|
owner.ClearUnitState(UnitState.ChaseMove);
|
||||||
owner.SetInFront(target);
|
owner.SetInFront(target);
|
||||||
|
DoMovementInform(owner, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the target moved, we have to consider whether to adjust
|
// if the target moved, we have to consider whether to adjust
|
||||||
@@ -211,5 +209,16 @@ namespace Game.Movement
|
|||||||
return false;
|
return false;
|
||||||
return !angle.HasValue || angle.Value.IsAngleOkay(target.GetRelativeAngle(owner));
|
return !angle.HasValue || angle.Value.IsAngleOkay(target.GetRelativeAngle(owner));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void DoMovementInform(Unit owner, Unit target)
|
||||||
|
{
|
||||||
|
Creature cOwner = owner.ToCreature();
|
||||||
|
if (cOwner != null)
|
||||||
|
{
|
||||||
|
CreatureAI ai = cOwner.GetAI();
|
||||||
|
if (ai != null)
|
||||||
|
ai.MovementInform(MovementGeneratorType.Chase, (uint)target.GetGUID().GetCounter());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
using Framework.Constants;
|
using Framework.Constants;
|
||||||
using Framework.GameMath;
|
using Game.AI;
|
||||||
using Game.Entities;
|
using Game.Entities;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
@@ -75,6 +75,7 @@ namespace Game.Movement
|
|||||||
{
|
{
|
||||||
_path = null;
|
_path = null;
|
||||||
owner.StopMoving();
|
owner.StopMoving();
|
||||||
|
DoMovementInform(owner, target);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -84,6 +85,7 @@ namespace Game.Movement
|
|||||||
{
|
{
|
||||||
_path = null;
|
_path = null;
|
||||||
owner.ClearUnitState(UnitState.FollowMove);
|
owner.ClearUnitState(UnitState.FollowMove);
|
||||||
|
DoMovementInform(owner, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_lastTargetPosition.GetExactDistSq(target.GetPosition()) > 0.0f)
|
if (_lastTargetPosition.GetExactDistSq(target.GetPosition()) > 0.0f)
|
||||||
@@ -175,5 +177,15 @@ namespace Game.Movement
|
|||||||
|
|
||||||
return !angle.HasValue || angle.Value.IsAngleOkay(target.GetRelativeAngle(owner));
|
return !angle.HasValue || angle.Value.IsAngleOkay(target.GetRelativeAngle(owner));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void DoMovementInform(Unit owner, Unit target)
|
||||||
|
{
|
||||||
|
if (!owner.IsCreature())
|
||||||
|
return;
|
||||||
|
|
||||||
|
UnitAI ai = owner.GetAI();
|
||||||
|
if (ai != null)
|
||||||
|
((CreatureAI)ai).MovementInform(MovementGeneratorType.Follow, (uint)target.GetGUID().GetCounter());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user