Skip to content

Commit

Permalink
Fix Resolve with WayPoint: The final destination was reset by the way…
Browse files Browse the repository at this point in the history
…point.
  • Loading branch information
aurnoi1 committed Jul 19, 2019
1 parent b9be460 commit 88ccc39
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/IC.Navigation/NavigatorSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,24 @@ public virtual INavigable Resolve(INavigable origin, IOnActionAlternatives onAct
/// </summary>
/// <param name="origin">The origin before Action invocation.</param>
/// <param name="onActionAlternatives">All the alternative INavigables that can be rebased.</param>
/// <param name="waypoint">An INavigable waypoint to cross before to reach the expected INavigable.</param>
/// <param name="waypoint">An INavigable waypoint to cross if the expected INavigable is not cross during the resolution.</param>
/// <returns>The destination.</returns>
public virtual INavigable Resolve(INavigable origin, IOnActionAlternatives onActionAlternatives, INavigable waypoint)
{
var newOrigin = GetINavigableAfterAction(origin, onActionAlternatives);
// gotoDestination will be reset with the first call to GoTo().
var finalDestination = gotoDestination;
var navigableAfterAction = GetINavigableAfterAction(origin, onActionAlternatives);
if (CompareTypeNames(navigableAfterAction, finalDestination))
{
return navigableAfterAction;
}
else
{

// Force to pass by waypoint.
GoTo(newOrigin, waypoint);
return GoTo(waypoint, gotoDestination);
// Force to pass by waypoint.
GoTo(navigableAfterAction, waypoint);
return GoTo(waypoint, finalDestination);
}
}

/// <summary>
Expand Down

0 comments on commit 88ccc39

Please sign in to comment.