prevent most other-hand accidental firing

This commit is contained in:
James Pollack 2015-10-01 17:55:47 -07:00
parent 4a7e3c66bd
commit 7f841b3828

View file

@ -84,6 +84,7 @@
var _t = this;
this.canShootTimeout = Script.setTimeout(function() {
_t.canShoot = false;
_t.whichHand=null;
}, 250)
},
@ -97,7 +98,7 @@
if (this.triggerValue < RELOAD_THRESHOLD) {
// print('RELOAD');
this.canShoot = true;
} else if (this.triggerValue >= RELOAD_THRESHOLD && this.canShoot === true) {
} else if (this.triggerValue >= RELOAD_THRESHOLD && this.canShoot === true && this.hand === this.whichHand) {
var gunProperties = Entities.getEntityProperties(this.entityID, ["position", "rotation"]);
this.shootBall(gunProperties);
this.canShoot = false;