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* namestring pointer in eachFsEnrouteLeg FsEnrouteLeg* enrouteLegspointer inFsPlannedRoute- 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);
}