diff --git a/Source/Game/AI/SmartScripts/SmartAI.cs b/Source/Game/AI/SmartScripts/SmartAI.cs index 0ce5707cc..9fecad382 100644 --- a/Source/Game/AI/SmartScripts/SmartAI.cs +++ b/Source/Game/AI/SmartScripts/SmartAI.cs @@ -340,15 +340,19 @@ namespace Game.AI if (mWPReached)//reached WP { mWPReached = false; - SmartPath wp = GetNextWayPoint(); + if (mCurrentWPID == GetWPCount()) { EndPath(); } - else if (wp != null) + else { - SetRun(mRun); - me.GetMotionMaster().MovePoint(wp.id, wp.x, wp.y, wp.z); + SmartPath wp = GetNextWayPoint(); + if (wp != null) + { + SetRun(mRun); + me.GetMotionMaster().MovePoint(wp.id, wp.x, wp.y, wp.z); + } } } } diff --git a/Source/Game/AI/SmartScripts/SmartScript.cs b/Source/Game/AI/SmartScripts/SmartScript.cs index 4db0519f7..c77efebe8 100644 --- a/Source/Game/AI/SmartScripts/SmartScript.cs +++ b/Source/Game/AI/SmartScripts/SmartScript.cs @@ -1473,7 +1473,7 @@ namespace Game.AI break; List targets = GetTargets(e, unit); 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) me.SetFacingTo(e.Target.o); else if (!targets.Empty())