prop-key-handler.nas: check for nil property
tutorial.nas, globals.nas, controls.nas: cosmetics
This commit is contained in:
parent
93b06dc514
commit
ecf469e295
4 changed files with 4 additions and 4 deletions
|
@ -391,7 +391,7 @@ var ptt = func(b) setprop("/instrumentation/comm/ptt", b);
|
|||
##
|
||||
# Lighting
|
||||
#
|
||||
var toggleLights = func () {
|
||||
var toggleLights = func {
|
||||
if (getprop("/controls/switches/panel-lights")) {
|
||||
setprop("/controls/switches/panel-lights-factor", 0);
|
||||
setprop("/controls/switches/panel-lights", 0);
|
||||
|
|
|
@ -125,7 +125,7 @@ var handle_key = func(key, shift) {
|
|||
input = complete(explicit_input, shift ? -1 : 1);
|
||||
build_completion(explicit_input);
|
||||
var n = call(func { props.globals.getNode(input) }, [], var err = []);
|
||||
if (!size(err) and n.getAttribute("children") and size(completion) == 1)
|
||||
if (!size(err) and n != nil and n.getAttribute("children") and size(completion) == 1)
|
||||
handle_key(`/`, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ var startTutorial = func {
|
|||
var presets = tutorialN.getChild("presets");
|
||||
if (presets != nil) {
|
||||
props.copy(presets, props.globals.getNode("/sim/presets"));
|
||||
fgcommand("presets-commit", props.Node.new());
|
||||
fgcommand("presets-commit");
|
||||
|
||||
if (getprop("/sim/presets/on-ground")) {
|
||||
var eng = props.globals.getNode("/controls/engines");
|
||||
|
|
Loading…
Add table
Reference in a new issue