mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:03:55 +02:00
protect beam disabler from others
This commit is contained in:
parent
50c1786e9b
commit
be7d52a773
1 changed files with 10 additions and 8 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue