From 16086cac2dcb7a4cb8b2cd475952245f388e96b9 Mon Sep 17 00:00:00 2001 From: Delta Echo Date: Sat, 31 Aug 2019 10:20:15 +0200 Subject: [PATCH] [Nasal]Add possibility to recognise drag robots for glider towing --- Nasal/towing/hitch.nas | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Nasal/towing/hitch.nas b/Nasal/towing/hitch.nas index aec20ea6e..13f988288 100644 --- a/Nasal/towing/hitch.nas +++ b/Nasal/towing/hitch.nas @@ -599,10 +599,11 @@ var findBestAIObject = func (){ if ( (var node = aimember.getName() ) != nil ) { nodeIsAiAircraft = 0; nodeIsMpAircraft = 0; - if ( sprintf("%8s",node) == "aircraft" ) nodeIsAiAircraft = 1; + if ( sprintf("%8s",node) == "aircraft" or sprintf("%7s",node) == "dragger" ) nodeIsAiAircraft = 1; if ( sprintf("%11s",node) == "multiplayer" ) nodeIsMpAircraft = 1; - #print("found NodeName=",node," nodeIsAiAircraft=",nodeIsAiAircraft," nodeIsMpAircraft=",nodeIsMpAircraft ); - if ( !nodeIsAiAircraft and !nodeIsMpAircraft ) continue; + #print("found NodeName=",node," nodeIsAiAircraft=",nodeIsAiAircraft," nodeIsMpAircraft=",nodeIsMpAircraft); + if ( aimember.getNode("valid") == nil ) continue; + if ( !nodeIsAiAircraft and !nodeIsMpAircraft) continue; if ( !aimember.getNode("valid").getValue() ) continue; # node is invalid if( running_as_autoconnect ) { @@ -1822,4 +1823,4 @@ var PointRotate3D = func (x,y,z,xr,yr,zr,alpha_deg,beta_deg,gamma_deg){ # - dynamic ID for ai-rope-model # # Please contact D_NXKT at yahoo.de for bug-reports, suggestions, ... -# \ No newline at end of file +#