mirror of
https://github.com/overte-org/overte.git
synced 2025-08-13 08:36:46 +02:00
stop findGroupParent at cloneable
This commit is contained in:
parent
43435bdeae
commit
98a8d3361b
4 changed files with 8 additions and 3 deletions
|
@ -3676,6 +3676,7 @@ bool EntityItemProperties::verifyStaticCertificateProperties() {
|
|||
void EntityItemProperties::convertToCloneProperties(const EntityItemID& entityIDToClone) {
|
||||
setName(getName() + "-clone-" + entityIDToClone.toString());
|
||||
setLocked(false);
|
||||
setParentID(QUuid());
|
||||
setLifetime(getCloneLifetime());
|
||||
setDynamic(getCloneDynamic());
|
||||
setClientOnly(getCloneAvatarEntity());
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
var canGrabEntity = false;
|
||||
if (dispatcherUtils.entityIsGrabbable(props) || entityIsCloneable(props)) {
|
||||
// if we've attempted to grab a child, roll up to the root of the tree
|
||||
var groupRootProps = dispatcherUtils.findGroupParent(controllerData, props);
|
||||
var groupRootProps = dispatcherUtils.findGroupParent(controllerData, props, false);
|
||||
canGrabEntity = true;
|
||||
if (!dispatcherUtils.entityIsGrabbable(groupRootProps)) {
|
||||
canGrabEntity = false;
|
||||
|
|
|
@ -254,7 +254,8 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
|
|||
this.hapticTargetID = props.id;
|
||||
}
|
||||
// if we've attempted to grab a child, roll up to the root of the tree
|
||||
var groupRootProps = findGroupParent(controllerData, props);
|
||||
var stopAtCloneable = true;
|
||||
var groupRootProps = findGroupParent(controllerData, props, stopAtCloneable);
|
||||
if (entityIsGrabbable(groupRootProps)) {
|
||||
return groupRootProps;
|
||||
}
|
||||
|
|
|
@ -355,10 +355,13 @@ ensureDynamic = function (entityID) {
|
|||
}
|
||||
};
|
||||
|
||||
findGroupParent = function (controllerData, targetProps) {
|
||||
findGroupParent = function (controllerData, targetProps, stopAtCloneable) {
|
||||
while (targetProps.parentID &&
|
||||
targetProps.parentID !== Uuid.NULL &&
|
||||
Entities.getNestableType(targetProps.parentID) == "entity") {
|
||||
if (stopAtCloneable && entityIsCloneable(targetProps)) {
|
||||
break;
|
||||
}
|
||||
var parentProps = Entities.getEntityProperties(targetProps.parentID, DISPATCHER_PROPERTIES);
|
||||
if (!parentProps) {
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue