mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +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.robbed = false;
|
||||
this.highlightedEntity = null;
|
||||
this.cloneAllowed = true;
|
||||
|
||||
this.parameters = makeDispatcherModuleParameters(
|
||||
500,
|
||||
|
@ -272,6 +273,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
|
|||
controllerData.secondaryValues[this.hand] < TRIGGER_OFF_VALUE) {
|
||||
this.checkForUnexpectedChildren(controllerData);
|
||||
this.robbed = false;
|
||||
this.cloneAllowed = true;
|
||||
return makeRunningValues(false, [], []);
|
||||
}
|
||||
|
||||
|
@ -335,12 +337,14 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
|
|||
var targetCloneable = entityIsCloneable(targetProps);
|
||||
|
||||
if (targetCloneable) {
|
||||
var cloneID = cloneEntity(targetProps);
|
||||
var cloneProps = Entities.getEntityProperties(cloneID);
|
||||
this.grabbing = true;
|
||||
this.targetEntityID = cloneID;
|
||||
this.startNearParentingGrabEntity(controllerData, cloneProps);
|
||||
|
||||
if (this.cloneAllowed) {
|
||||
var cloneID = cloneEntity(targetProps);
|
||||
var cloneProps = Entities.getEntityProperties(cloneID);
|
||||
this.grabbing = true;
|
||||
this.targetEntityID = cloneID;
|
||||
this.startNearParentingGrabEntity(controllerData, cloneProps);
|
||||
this.cloneAllowed = false;
|
||||
}
|
||||
} else if (targetProps) {
|
||||
this.grabbing = true;
|
||||
this.startNearParentingGrabEntity(controllerData, targetProps);
|
||||
|
|
Loading…
Reference in a new issue