1
0
Fork 0

- update hud paths

- check for negative index
This commit is contained in:
mfranz 2006-06-08 17:18:03 +00:00
parent 89162607d9
commit dfd3fc3212

View file

@ -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 &lt; 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 {