Core/SmartScripts: Fixes repeating events to soon when using waypoints
This commit is contained in:
@@ -340,18 +340,22 @@ namespace Game.AI
|
|||||||
if (mWPReached)//reached WP
|
if (mWPReached)//reached WP
|
||||||
{
|
{
|
||||||
mWPReached = false;
|
mWPReached = false;
|
||||||
SmartPath wp = GetNextWayPoint();
|
|
||||||
if (mCurrentWPID == GetWPCount())
|
if (mCurrentWPID == GetWPCount())
|
||||||
{
|
{
|
||||||
EndPath();
|
EndPath();
|
||||||
}
|
}
|
||||||
else if (wp != null)
|
else
|
||||||
|
{
|
||||||
|
SmartPath wp = GetNextWayPoint();
|
||||||
|
if (wp != null)
|
||||||
{
|
{
|
||||||
SetRun(mRun);
|
SetRun(mRun);
|
||||||
me.GetMotionMaster().MovePoint(wp.id, wp.x, wp.y, wp.z);
|
me.GetMotionMaster().MovePoint(wp.id, wp.x, wp.y, wp.z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void UpdateAI(uint diff)
|
public override void UpdateAI(uint diff)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1473,7 +1473,7 @@ namespace Game.AI
|
|||||||
break;
|
break;
|
||||||
List<WorldObject> targets = GetTargets(e, unit);
|
List<WorldObject> targets = GetTargets(e, unit);
|
||||||
if (e.GetTargetType() == SmartTargets.Self)
|
if (e.GetTargetType() == SmartTargets.Self)
|
||||||
me.SetFacingTo(me.GetHomePosition().GetOrientation());
|
me.SetFacingTo((me.GetTransport() ? me.GetTransportHomePosition() : me.GetHomePosition()).GetOrientation());
|
||||||
else if (e.GetTargetType() == SmartTargets.Position)
|
else if (e.GetTargetType() == SmartTargets.Position)
|
||||||
me.SetFacingTo(e.Target.o);
|
me.SetFacingTo(e.Target.o);
|
||||||
else if (!targets.Empty())
|
else if (!targets.Empty())
|
||||||
|
|||||||
Reference in New Issue
Block a user