- update hud paths
- check for negative index
This commit is contained in:
parent
89162607d9
commit
dfd3fc3212
1 changed files with 3 additions and 3 deletions
|
@ -570,8 +570,8 @@ calculated by adding 256 to the GLUT key value in glut.h.
|
|||
<command>nasal</command>
|
||||
<script>
|
||||
if (getprop("/sim/hud/visibility")) {
|
||||
var br = getprop("/sim/hud/brightness") - 0.2;
|
||||
setprop("/sim/hud/brightness", br > 0.01 ? br : 1);
|
||||
var br = getprop("/sim/hud/color/brightness") - 0.2;
|
||||
setprop("/sim/hud/color/brightness", br > 0.01 ? br : 1);
|
||||
}
|
||||
</script>
|
||||
</binding>
|
||||
|
@ -755,7 +755,7 @@ calculated by adding 256 to the GLUT key value in glut.h.
|
|||
return setprop("/sim/hud/visibility", 1);
|
||||
}
|
||||
var i = getprop("/sim/hud/current-color") + 1;
|
||||
if (i >= size(props.globals.getNode("/sim/hud/colors", 1).getChildren("color"))) {
|
||||
if (i < 0 or i >= size(props.globals.getNode("/sim/hud/palette", 1).getChildren("color"))) {
|
||||
setprop("/sim/hud/visibility", 0);
|
||||
setprop("/sim/hud/current-color", 0);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue