1
0
forked from 0ad/0ad

Send messages when formation members hit fail to find a path or are obstructed.

This was SVN commit r12613.
This commit is contained in:
Deiz 2012-09-03 02:59:15 +00:00
parent 66318d7011
commit d805c87249

View File

@ -625,8 +625,16 @@ void CCmpUnitMotion::PathResult(u32 ticket, const ICmpPathfinder::Path& path)
// If there's no waypoints then we couldn't get near the target
if (m_ShortPath.m_Waypoints.empty())
{
StartFailed();
return;
if (!IsFormationMember())
{
StartFailed();
return;
}
else
{
CMessageMotionChanged msg(true, true);
GetSimContext().GetComponentManager().PostMessage(GetEntityId(), msg);
}
}
CmpPtr<ICmpPosition> cmpPosition(GetSimContext(), GetEntityId());
@ -694,6 +702,11 @@ void CCmpUnitMotion::PathResult(u32 ticket, const ICmpPathfinder::Path& path)
MoveFailed();
return;
}
else
{
CMessageMotionChanged msg(false, true);
GetSimContext().GetComponentManager().PostMessage(GetEntityId(), msg);
}
}
m_PathState = PATHSTATE_FOLLOWING;