mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-18 21:48:48 +02:00
prevent continuous clone calls
This commit is contained in:
parent
6484c866f3
commit
6c946d7ac5
1 changed files with 10 additions and 6 deletions
|
@ -35,6 +35,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
|
||||||
this.lastUnexpectedChildrenCheckTime = 0;
|
this.lastUnexpectedChildrenCheckTime = 0;
|
||||||
this.robbed = false;
|
this.robbed = false;
|
||||||
this.highlightedEntity = null;
|
this.highlightedEntity = null;
|
||||||
|
this.cloneAllowed = true;
|
||||||
|
|
||||||
this.parameters = makeDispatcherModuleParameters(
|
this.parameters = makeDispatcherModuleParameters(
|
||||||
500,
|
500,
|
||||||
|
@ -272,6 +273,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
|
||||||
controllerData.secondaryValues[this.hand] < TRIGGER_OFF_VALUE) {
|
controllerData.secondaryValues[this.hand] < TRIGGER_OFF_VALUE) {
|
||||||
this.checkForUnexpectedChildren(controllerData);
|
this.checkForUnexpectedChildren(controllerData);
|
||||||
this.robbed = false;
|
this.robbed = false;
|
||||||
|
this.cloneAllowed = true;
|
||||||
return makeRunningValues(false, [], []);
|
return makeRunningValues(false, [], []);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,12 +337,14 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
|
||||||
var targetCloneable = entityIsCloneable(targetProps);
|
var targetCloneable = entityIsCloneable(targetProps);
|
||||||
|
|
||||||
if (targetCloneable) {
|
if (targetCloneable) {
|
||||||
|
if (this.cloneAllowed) {
|
||||||
var cloneID = cloneEntity(targetProps);
|
var cloneID = cloneEntity(targetProps);
|
||||||
var cloneProps = Entities.getEntityProperties(cloneID);
|
var cloneProps = Entities.getEntityProperties(cloneID);
|
||||||
this.grabbing = true;
|
this.grabbing = true;
|
||||||
this.targetEntityID = cloneID;
|
this.targetEntityID = cloneID;
|
||||||
this.startNearParentingGrabEntity(controllerData, cloneProps);
|
this.startNearParentingGrabEntity(controllerData, cloneProps);
|
||||||
|
this.cloneAllowed = false;
|
||||||
|
}
|
||||||
} else if (targetProps) {
|
} else if (targetProps) {
|
||||||
this.grabbing = true;
|
this.grabbing = true;
|
||||||
this.startNearParentingGrabEntity(controllerData, targetProps);
|
this.startNearParentingGrabEntity(controllerData, targetProps);
|
||||||
|
|
Loading…
Reference in a new issue