Skip to content

Commit

Permalink
Code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
BojoteX committed May 21, 2024
1 parent c94a2fe commit c95b755
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions FSAutoSave/FSAutoSave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ void CALLBACK Dispatcher(SIMCONNECT_RECV* pData, DWORD cbData, void* pContext)
printf("Aircraft Position: Not available or in Main Menu\n");
}
else {
if (positionRequester == 0) {
// if (positionRequester == 0) {
if (pS->sim_on_ground) {
if (pS->airspeed < 1) {
printf("Currently parked/stopped at Latitude: %f - Longitude: %f\n", pS->latitude, pS->longitude);
Expand All @@ -472,10 +472,9 @@ void CALLBACK Dispatcher(SIMCONNECT_RECV* pData, DWORD cbData, void* pContext)
}
}
else {
printf("Current position is Latitude: %f - Longitude: %f - Altitude: %.0f feet - Ground Speed: %.0f knots - Heading: %.0f degrees\n", pS->latitude, pS->longitude, pS->altitude, pS->airspeed, pS->mag_heading);

printf("Current position is Latitude: %f - Longitude: %f - Altitude: %.0f feet - Ground Speed: %.0f knots - Heading: %.0f degrees - Flaps: %.0f degrees - IAS: %.0f feet/sec\n", pS->latitude, pS->longitude, pS->altitude, pS->airspeed, pS->mag_heading, pS->flaps, pS->IASinFPS);
}
}
// }
}
break;
}
Expand Down
8 changes: 4 additions & 4 deletions FSAutoSave/Utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1026,8 +1026,6 @@ void finalSave() {

// We ONLY save LAST.FLT as CustomFlight.FLT is used to start only FRESH flights
if (!DEBUG) {
// Get the current position and the closest airport (including gate)
SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_CLOSEST_AIRPORT, 666, SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);

if (currentFlight == "LAST.FLT") {
auto last_modified = fs::last_write_time(currentFlightPath);
Expand All @@ -1041,6 +1039,10 @@ void finalSave() {
}
}
}

// Get the current position and the closest airport (including gate)
SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_CLOSEST_AIRPORT, 666, SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);

}
else {
printf("\n[DEBUG] Will skip saving as we are in DEBUG mode\n");
Expand Down Expand Up @@ -1194,8 +1196,6 @@ void saveDuringPause() {
// Save the situation (without needing to press CTRL+ALT+S or ESC)
SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_SITUATION_SAVE, 98, SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);

// Get the current position and the closest airport (including gate)
// SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_CLOSEST_AIRPORT, 666, SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
}
else {
printf("\n[PAUSE EX1] Simulator is paused\n");
Expand Down

0 comments on commit c95b755

Please sign in to comment.