mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 05:57:29 +02:00
Update bow.js to use setInterval
This commit is contained in:
parent
410271a5b6
commit
72da30e5bd
1 changed files with 13 additions and 6 deletions
|
@ -222,23 +222,30 @@ getControllerWorldLocation = function (handController, doOffset) {
|
||||||
setEntityCustomData('grabbableKey', this.entityID, data);
|
setEntityCustomData('grabbableKey', this.entityID, data);
|
||||||
|
|
||||||
this.initString();
|
this.initString();
|
||||||
|
|
||||||
|
var self = this;
|
||||||
|
this.intervalID = Script.setInterval(function() { self.update(); }, 11);
|
||||||
},
|
},
|
||||||
continueEquip: function(entityID, args) {
|
update: function(entityID) {
|
||||||
this.deltaTime = checkInterval();
|
var self = this;
|
||||||
|
self.deltaTime = checkInterval();
|
||||||
//debounce during debugging -- maybe we're updating too fast?
|
//debounce during debugging -- maybe we're updating too fast?
|
||||||
if (USE_DEBOUNCE === true) {
|
if (USE_DEBOUNCE === true) {
|
||||||
this.sinceLastUpdate = this.sinceLastUpdate + this.deltaTime;
|
self.sinceLastUpdate = self.sinceLastUpdate + self.deltaTime;
|
||||||
|
|
||||||
if (this.sinceLastUpdate > 60) {
|
if (self.sinceLastUpdate > 60) {
|
||||||
this.sinceLastUpdate = 0;
|
self.sinceLastUpdate = 0;
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.checkStringHand();
|
self.checkStringHand();
|
||||||
},
|
},
|
||||||
releaseEquip: function(entityID, args) {
|
releaseEquip: function(entityID, args) {
|
||||||
|
//Script.update.disconnect(this, this.update);
|
||||||
|
Script.clearInterval(this.intervalID);
|
||||||
|
|
||||||
Messages.sendLocalMessage('Hifi-Hand-Disabler', "none");
|
Messages.sendLocalMessage('Hifi-Hand-Disabler', "none");
|
||||||
|
|
||||||
this.stringDrawn = false;
|
this.stringDrawn = false;
|
||||||
|
|
Loading…
Reference in a new issue