From 9337a5446cf62ef07c8b71bd795cc40188bbe5fc Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 12 Jun 2001 16:25:36 +0000 Subject: [PATCH] Added David's 'real' patch rather than my guess at it. --- src/Main/Makefile.am | 2 +- src/Main/fg_props.hxx | 19 +++++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/Main/Makefile.am b/src/Main/Makefile.am index f08415609..d07f1e867 100644 --- a/src/Main/Makefile.am +++ b/src/Main/Makefile.am @@ -35,7 +35,7 @@ EXTRA_DIST = 3dfx.sh runfgfs.in runfgfs.bat.in bin_PROGRAMS = fgfs -noinst_SCRIPTS = runfgfs runfgfs.bat +noinst_SCRIPTS = runfgfs.bat bin_SCRIPTS = runfgfs diff --git a/src/Main/fg_props.hxx b/src/Main/fg_props.hxx index 5e936f5af..2eae51b8f 100644 --- a/src/Main/fg_props.hxx +++ b/src/Main/fg_props.hxx @@ -27,6 +27,7 @@ extern bool fgLoadFlight (istream &input); * * @param path The path of the node, relative to root. * @param create true to create the node if it doesn't exist. + * @return The node, or 0 if none exists and none was created. */ inline SGPropertyNode * fgGetNode (const string &path, bool create = false) @@ -35,24 +36,18 @@ fgGetNode (const string &path, bool create = false) } -#if 0 /** - * Get an SGValue pointer that can be queried repeatedly. + * Test whether a given node exists. * - * If the property value is going to be accessed within the loop, - * it is best to use this method for maximum efficiency. + * @param path The path of the node, relative to root. + * @return true if the node exists, false otherwise. */ -inline SGPropertyNode * -fgGetNode (const string &name, bool create = false) +inline bool +fgHasNode (const string &path) { - return globals->get_props()->getNode(name, create); + return (fgGetNode(path, false) != 0); } -#endif -inline bool fgHasNode (const string &name) -{ - return globals->get_props()->getNode(name) != NULL; -} inline bool fgGetBool (const string &name, bool defaultValue = false) { -- 2.39.5