Skip to content

Commit

Permalink
fix possible crash + spurious nose wheel TD recording
Browse files Browse the repository at this point in the history
  • Loading branch information
hotbso committed Nov 17, 2021
1 parent 759dc4a commit bba1bc3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xgs.c
Expand Up @@ -20,7 +20,7 @@
#include <acfutils/assert.h>
#include <acfutils/airportdb.h>

#define VERSION "3.40"
#define VERSION "3.41"

static float flight_loop_cb(float inElapsedSinceLastCall,
float inElapsedTimeSinceLastFlightLoop, int inCounter,
Expand Down Expand Up @@ -693,7 +693,8 @@ static void update_landing_result()
}

/* ToLiss specific: record distance to nose wheel td */
if (toliss_strut_compress_dr != NULL && nose_wheel_td_dist == 0.0) {
if (toliss_strut_compress_dr != NULL && nose_wheel_td_dist == 0.0 && landing_dist > 0.0
&& landing_rwy != NULL) { /* this on may be redundant but better be safe */
float sc;
int nw = toliss_a340 ? 3 : 0; /* narrow body: 0, A340: 3 */
XPLMGetDatavf(toliss_strut_compress_dr, &sc, nw, 1); /* nose wheel */
Expand Down

0 comments on commit bba1bc3

Please sign in to comment.