From be7d52a773d4df32176bab92560fcef9312eecb9 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Tue, 24 Nov 2015 13:35:53 -0800 Subject: [PATCH] protect beam disabler from others --- examples/controllers/handControllerGrab.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index 7f363c47ae..0a6aec6e7d 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -1216,7 +1216,6 @@ Controller.enableMapping(MAPPING_NAME); var handToDisable = 'none'; function update() { - // print('disabled in update:::'+handToDisable) if (handToDisable !== 0) { leftController.update(); } @@ -1228,14 +1227,17 @@ function update() { Messages.subscribe('Hifi-Beam-Disabler'); handleBeamDisablerMessages = function(channel, message, sender) { - print('GOT MESSAGE:::'+message) - handToDisable = message; - if (message === 'left') { - handToDisable = 1; - } - if (message === 'right') { - handToDisable = 0; + + if (sender === MyAvatar.sessionUUID) { + handToDisable = message; + if (message === 'left') { + handToDisable = 1; + } + if (message === 'right') { + handToDisable = 0; + } } + } Messages.messageReceived.connect(handleBeamDisablerMessages);