Index: ps/trunk/binaries/data/mods/public/simulation/components/UnitAI.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/components/UnitAI.js +++ ps/trunk/binaries/data/mods/public/simulation/components/UnitAI.js @@ -1240,8 +1240,11 @@ // a group of unit and does not have a well-defined position, // so move the controller out of the world to enforce that. let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); - if (cmpPosition) + if (cmpPosition && cmpPosition.IsInWorld()) + { + this.StopMoving(); cmpPosition.MoveOutOfWorld(); + } this.StartTimer(1000, 1000); return false; Index: ps/trunk/source/simulation2/components/CCmpUnitMotion.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpUnitMotion.cpp +++ ps/trunk/source/simulation2/components/CCmpUnitMotion.cpp @@ -1075,14 +1075,13 @@ // Inform other components - we might be ordered to stop, and computeGoal will then fail and return early. MoveObstructed(); - CFixedVector2D pos = cmpPosition->GetPosition2D(); - - // Oops, we hit something (very likely another unit). - PathGoal goal; if (!ComputeGoal(goal, m_MoveRequest)) return false; + // At this point we have a position in the world since ComputeGoal checked for that. + CFixedVector2D pos = cmpPosition->GetPosition2D(); + if (!InShortPathRange(goal, pos)) { // If we still have long waypoints, try and compute a short path to our next long waypoint.