fsPlannedRouteGetEfbRoute

Get the player's route, as seen on the EFB.

 

Syntax
FsPlannedRoute* fsPlannedRouteGetEfbRoute();

 

Parameters

N/A

 

Return Values

The function will return the player's route if one exists and the call was successful. A nullptr will be returned otherwise.

 

Example
FsPlannedRoute* plannedRoute = fsPlannedRouteGetEfbRoute();

 

Remarks

Data returned by this function must be properly freed in order to avoid memory leaks. The following items are allocated when this call is made and must be freed by the caller:

  • The char* name string pointer in each FsEnrouteLeg
  • FsEnrouteLeg* enrouteLegs pointer in FsPlannedRoute
  • The FsPlannedRoute* pointer returned by this function itself

 

An example of how to properly free this data would be:

static void FreeRoute(FsPlannedRoute* route) {
	if (!route) {
		return;
	}
	for (int i = 0; i < route->numEnrouteLegs; i++) {
		free(route->enrouteLegs[i].name);	
	}
	free(route->enrouteLegs);
	free(route);
}