From f491fd5291e079c0790c778daa7dc8b57079f564 Mon Sep 17 00:00:00 2001 From: mfranz Date: Sat, 24 Jun 2006 12:31:58 +0000 Subject: [PATCH] add interface function for selecting weapons --- Nasal/controls.nas | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Nasal/controls.nas b/Nasal/controls.nas index 87fb1ff4e..60eb6c37d 100644 --- a/Nasal/controls.nas +++ b/Nasal/controls.nas @@ -356,4 +356,10 @@ applyParkingBrake = func(v) { # Weapon handling. # trigger = func(b) { setprop("/controls/armament/trigger", b); } +weaponSelect = func(d) { + var ws = props.globals.getNode("/controls/armament/selected", 1); + var n = ws.getValue(); + if (n == nil) { n = 0; } + ws.setIntValue(n + d); +}