From e9b12b302ffab1dc8b61814679bfdc9e47be2cec Mon Sep 17 00:00:00 2001 From: Richard Harrison Date: Fri, 10 Jan 2020 20:00:55 +0100 Subject: [PATCH] Fix Tanker when no offset specificed --- Nasal/tanker.nas | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Nasal/tanker.nas b/Nasal/tanker.nas index 1799781f6..be80ddc0b 100644 --- a/Nasal/tanker.nas +++ b/Nasal/tanker.nas @@ -250,9 +250,19 @@ var Tanker = { me.elevN.setDoubleValue(elev); # Determine if any of the contact points are in contact - var offset_x = refuelOffsetX.getValue() or 0; - var offset_y = refuelOffsetY.getValue() or 0; - var offset_z = refuelOffsetZ.getValue() or 0; + var offset_x = 0; + var offset_y = 0; + var offset_z = 0; + + if (refuelOffsetX != nil) + offset_x = refuelOffsetX.getValue() or 0; + + if (refuelOffsetY != nil) + offset_y = refuelOffsetY.getValue() or 0; + + if (refuelOffsetZ != nil) + offset_z = refuelOffsetZ.getValue() or 0; + var roll = acRoll.getValue() * globals.D2R; # Determine contact position