]> git.mxchange.org Git - flightgear.git/commitdiff
revert condition() patch. This can as easily be done in pure Nasal.
authormfranz <mfranz>
Sun, 18 Mar 2007 10:52:11 +0000 (10:52 +0000)
committermfranz <mfranz>
Sun, 18 Mar 2007 10:52:11 +0000 (10:52 +0000)
src/Scripting/NasalSys.cxx

index 9494575f7f08586f0b47ba80b7e36486d428cbef..aad9438fb7f78172176815a5549a9542faa635d6 100644 (file)
@@ -12,7 +12,6 @@
 
 #include <simgear/nasal/nasal.h>
 #include <simgear/props/props.hxx>
-#include <simgear/props/condition.hxx>
 #include <simgear/math/sg_random.h>
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/misc/interpolator.hxx>
@@ -281,24 +280,6 @@ static naRef f_removelistener(naContext c, naRef me, int argc, naRef* args)
     return nasal->removeListener(c, argc, args);
 }
 
-// condition(property) extension function. Evaluates standard <condition>
-// (see $FG_ROOT/Docs/README.condition) and returns state.
-static naRef f_condition(naContext c, naRef me, int argc, naRef* args)
-{
-    SGPropertyNode* node;
-    naRef prop = argc > 0 ? args[0] : naNil();
-    if(naIsString(prop)) node = fgGetNode(naStr_data(prop), true);
-    else if(naIsGhost(prop)) node = *(SGPropertyNode_ptr*)naGhost_ptr(prop);
-    else {
-        naRuntimeError(c, "condition() with invalid property");
-        return naNil();
-    }
-    SGCondition *cond = sgReadCondition(globals->get_props(), node);
-    bool result = cond->test();
-    delete cond;
-    return naNum(result == true ? 1 : 0);
-}
-
 // Returns a ghost handle to the argument to the currently executing
 // command
 static naRef f_cmdarg(naContext c, naRef me, int argc, naRef* args)
@@ -375,7 +356,6 @@ static struct { char* name; naCFunction func; } funcs[] = {
     { "settimer",  f_settimer },
     { "_setlistener", f_setlistener },
     { "removelistener", f_removelistener },
-    { "_condition", f_condition },
     { "_cmdarg",  f_cmdarg },
     { "_interpolate",  f_interpolate },
     { "rand",  f_rand },