mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 02:03:57 +02:00
Check for avatar collision in assignment as well
This commit is contained in:
parent
8d199ded15
commit
1212fefa61
1 changed files with 14 additions and 3 deletions
|
@ -11,6 +11,8 @@
|
|||
|
||||
#include "AssignmentParentFinder.h"
|
||||
|
||||
#include <AvatarHashMap.h>
|
||||
|
||||
SpatiallyNestableWeakPointer AssignmentParentFinder::find(QUuid parentID, bool& success, SpatialParentTree* entityTree) const {
|
||||
SpatiallyNestableWeakPointer parent;
|
||||
|
||||
|
@ -25,10 +27,19 @@ SpatiallyNestableWeakPointer AssignmentParentFinder::find(QUuid parentID, bool&
|
|||
} else {
|
||||
parent = _tree->findEntityByEntityItemID(parentID);
|
||||
}
|
||||
if (parent.expired()) {
|
||||
success = false;
|
||||
} else {
|
||||
if (!parent.expired()) {
|
||||
success = true;
|
||||
return parent;
|
||||
}
|
||||
|
||||
// search avatars
|
||||
auto avatarHashMap = DependencyManager::get<AvatarHashMap>();
|
||||
parent = avatarHashMap->getAvatarBySessionID(parentID);
|
||||
if (!parent.expired()) {
|
||||
success = true;
|
||||
return parent;
|
||||
}
|
||||
|
||||
success = false;
|
||||
return parent;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue