make findAncestorOfType understand AVATAR_SELF_ID

This commit is contained in:
Seth Alves 2017-02-03 16:43:36 -08:00
parent 22f9fc7061
commit ad83f20199

View file

@ -1055,6 +1055,14 @@ bool SpatiallyNestable::hasAncestorOfType(NestableType nestableType) const {
const QUuid SpatiallyNestable::findAncestorOfType(NestableType nestableType) const {
bool success;
if (nestableType == NestableType::Avatar) {
QUuid parentID = getParentID();
if (parentID == AVATAR_SELF_ID) {
return AVATAR_SELF_ID; // TODO -- can we put nodeID here?
}
}
SpatiallyNestablePointer parent = getParentPointer(success);
if (!success || !parent) {
return QUuid();