From 937ec42fda3317aca0f9c37fbf139ac3af1378e1 Mon Sep 17 00:00:00 2001 From: mfranz Date: Sun, 18 Mar 2007 10:52:11 +0000 Subject: [PATCH] revert condition() patch. This can as easily be done in pure Nasal. --- src/Scripting/NasalSys.cxx | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx index 9494575f7..aad9438fb 100644 --- a/src/Scripting/NasalSys.cxx +++ b/src/Scripting/NasalSys.cxx @@ -12,7 +12,6 @@ #include #include -#include #include #include #include @@ -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 -// (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 },