From c48c1a06e80c3bd380852c1586e8753f2ed78b74 Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 17 Dec 2019 22:34:19 +0000 Subject: [PATCH] Look for protocols in aircraft paths Modified from patch by Slawek Mikula --- src/Network/generic.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Network/generic.cxx b/src/Network/generic.cxx index bb97f5c00..e8199fa1a 100644 --- a/src/Network/generic.cxx +++ b/src/Network/generic.cxx @@ -753,13 +753,14 @@ bool FGGeneric::close() { void FGGeneric::reinit() { - SGPath path( globals->get_fg_root() ); - path.append("Protocol"); - path.append(file_name.c_str()); - - SG_LOG(SG_NETWORK, SG_INFO, "Reading communication protocol from " - << path); - + SGPath path = globals->resolve_maybe_aircraft_path("Protocol/" + file_name); + if (!path.exists()) { + SG_LOG(SG_NETWORK, SG_WARN, "Couldn't find protocol file for '" << file_name << "'"); + return; + } + + SG_LOG(SG_NETWORK, SG_INFO, "Reading communication protocol from " << path); + SGPropertyNode root; try { readProperties(path, &root);