mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:35:08 +02:00
only send startNearTrigger once
This commit is contained in:
parent
ec80846281
commit
644532dd59
1 changed files with 8 additions and 4 deletions
|
@ -26,6 +26,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
this.previousParentID = {};
|
||||
this.previousParentJointIndex = {};
|
||||
this.previouslyUnhooked = {};
|
||||
this.startSent = false;
|
||||
|
||||
this.parameters = makeDispatcherModuleParameters(
|
||||
520,
|
||||
|
@ -76,7 +77,6 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
var targetProps = this.getTargetProps(controllerData);
|
||||
if (targetProps) {
|
||||
this.targetEntityID = targetProps.id;
|
||||
this.startNearTrigger(controllerData);
|
||||
return makeRunningValues(true, [this.targetEntityID], []);
|
||||
} else {
|
||||
return makeRunningValues(false, [], []);
|
||||
|
@ -84,12 +84,16 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
};
|
||||
|
||||
this.run = function (controllerData) {
|
||||
if (controllerData.triggerClicks[this.hand] === 0) {
|
||||
if (!this.startSent) {
|
||||
this.startNearTrigger(controllerData);
|
||||
this.startSent = true;
|
||||
} else if (controllerData.triggerClicks[this.hand] === 0) {
|
||||
this.endNearTrigger(controllerData);
|
||||
this.startSent = false;
|
||||
return makeRunningValues(false, [], []);
|
||||
} else {
|
||||
this.continueNearTrigger(controllerData);
|
||||
}
|
||||
|
||||
this.continueNearTrigger(controllerData);
|
||||
return makeRunningValues(true, [this.targetEntityID], []);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue