Index: ps/trunk/source/simulation2/components/CCmpUnitMotion.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpUnitMotion.cpp +++ ps/trunk/source/simulation2/components/CCmpUnitMotion.cpp @@ -674,8 +674,8 @@ } PathGoal goal; - ComputeGoal(goal, m_MoveRequest); - RequestLongPath(pos, goal); + if (ComputeGoal(goal, m_MoveRequest)) + RequestLongPath(pos, goal); return; } @@ -748,8 +748,8 @@ if (PathingUpdateNeeded(pos)) { PathGoal goal; - ComputeGoal(goal, m_MoveRequest); - BeginPathing(pos, goal); + if (ComputeGoal(goal, m_MoveRequest)) + BeginPathing(pos, goal); } } @@ -896,7 +896,9 @@ // Else, just entirely recompute PathGoal goal; - ComputeGoal(goal, m_MoveRequest); + if (!ComputeGoal(goal, m_MoveRequest)) + return false; + BeginPathing(pos, goal); // potential TODO: We could switch the short-range pathfinder for something else entirely. @@ -962,7 +964,8 @@ // Move the goal to match the target entity's new position PathGoal goal; - ComputeGoal(goal, m_MoveRequest); + if (!ComputeGoal(goal, m_MoveRequest)) + return false; goal.x = targetPos.X; goal.z = targetPos.Y; // (we ignore changes to the target's rotation, since only buildings are