From: mfranz Date: Mon, 30 Jan 2006 12:29:58 +0000 (+0000) Subject: support optional setlistener() arg to fire callback function initially X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9efe35b86ad0c2873d6117865bdc3c646361f7f5;p=flightgear.git support optional setlistener() arg to fire callback function initially --- diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx index 9447f90be..001ee7043 100644 --- a/src/Scripting/NasalSys.cxx +++ b/src/Scripting/NasalSys.cxx @@ -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