40ff13b65b
Definitely problems in aar.nas, seaport.nas; as these were hanging off a fdm-initialized. The others have timers that are started from a listener and as such are more suited to use maketimer rather than settimer The modules that use the loopid technique are probably fine, but these are also more suited (and easier to understand) using a maketimer
18 lines
613 B
Text
18 lines
613 B
Text
seaportLoop = func {
|
|
var typ = getprop("/sim/type");
|
|
var lat = getprop("/position/latitude-deg");
|
|
var lon = getprop("/position/longitude-deg");
|
|
var g = geodinfo(lat, lon);
|
|
if ((g != nil and g[1] != nil and g[1].solid) and (typ == "seaplane") )
|
|
fgcommand("dialog-show", props.Node.new({ "dialog-name": "seaport" }));
|
|
};
|
|
seaportTimer = maketimer(8, seaportLoop);
|
|
seaportTimer.simulatedTime = 1;
|
|
|
|
_setlistener("/sim/signals/nasal-dir-initialized", func {
|
|
_setlistener("/sim/presets/latitude-deg", func {
|
|
printlog("info", "*** NEW LOCATION ***");
|
|
seaportTimer.restart(8);
|
|
|
|
}, 1);
|
|
});
|