mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-10 17:23:15 +02:00
extra check to make sure we remove material from MyAvatar
This commit is contained in:
parent
fd245b61ab
commit
924bf53698
2 changed files with 10 additions and 3 deletions
|
@ -229,8 +229,9 @@ AvatarSharedPointer AvatarHashMap::newOrExistingAvatar(const QUuid& sessionUUID,
|
|||
|
||||
AvatarSharedPointer AvatarHashMap::findAvatar(const QUuid& sessionUUID) const {
|
||||
QReadLocker locker(&_hashLock);
|
||||
if (_avatarHash.contains(sessionUUID)) {
|
||||
return _avatarHash.value(sessionUUID);
|
||||
auto avatarIter = _avatarHash.find(sessionUUID);
|
||||
if (avatarIter != _avatarHash.end()) {
|
||||
return avatarIter.value();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -358,7 +358,13 @@ void MaterialEntityRenderer::deleteMaterial(const QUuid& oldParentID, const QStr
|
|||
return;
|
||||
}
|
||||
|
||||
// if a remove fails, our parent is gone, so we don't need to retry
|
||||
// if a remove fails, our parent is gone, so we don't need to retry, EXCEPT:
|
||||
// MyAvatar can change UUIDs when you switch domains, which leads to a timing issue. Let's just make
|
||||
// sure we weren't attached to MyAvatar by trying this (if we weren't, this will have no effect)
|
||||
if (EntityTreeRenderer::removeMaterialFromAvatar(AVATAR_SELF_ID, material, oldParentMaterialNameStd)) {
|
||||
_appliedMaterial = nullptr;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void MaterialEntityRenderer::applyTextureTransform(std::shared_ptr<NetworkMaterial>& material) {
|
||||
|
|
Loading…
Reference in a new issue