]> git.mxchange.org Git - flightgear.git/commitdiff
support optional setlistener() arg to fire callback function initially
authormfranz <mfranz>
Mon, 30 Jan 2006 12:29:58 +0000 (12:29 +0000)
committermfranz <mfranz>
Mon, 30 Jan 2006 12:29:58 +0000 (12:29 +0000)
src/Scripting/NasalSys.cxx

index 9447f90be6022db995681b5d18cbd508db73c35d..001ee7043a384fda8657962bc866b7b4904ed4e4 100644 (file)
@@ -618,7 +618,8 @@ void FGNasalSys::setListener(int argc, naRef* args)
         return;
 
     gcSave(handler);
-    node->addChangeListener(new FGNasalListener(handler, this));
+    bool initial = argc > 2 && naTrue(args[2]);
+    node->addChangeListener(new FGNasalListener(handler, this), initial);
 }
 
 // functions providing access to the NasalDisplay - used to display text directly on the screen