Prevent calling ending on displayNames if was never started

This commit is contained in:
Cristian Luis Duarte 2018-05-11 22:27:58 -03:00
parent 3fd8a02375
commit aaa6038d28

View file

@ -128,7 +128,13 @@ function excludeMyAvatar() {
rayExclusionList = [MyAvatar.sessionUUID];
}
var runAtLeastOnce = false;
function ending() {
if (!runAtLeastOnce) {
return;
}
Controller.touchBeginEvent.disconnect(touchBegin);
Controller.touchEndEvent.disconnect(touchEnd);
Controller.mousePressEvent.disconnect(touchBegin);
@ -157,6 +163,8 @@ function init() {
rayExclusionList = [MyAvatar.sessionUUID];
MyAvatar.sessionUUIDChanged.connect(excludeMyAvatar);
runAtLeastOnce = true;
}
module.exports = {