This commit is contained in:
SamGondelman 2019-01-16 14:14:01 -08:00
parent 68e15c6c07
commit 9727c8fd38
3 changed files with 9 additions and 9 deletions

View file

@ -171,7 +171,7 @@ void AvatarBookmarks::updateAvatarEntities(const QVariantList &avatarEntities) {
// Remove any old entities not in the new list // Remove any old entities not in the new list
for (auto& avatarEntityID : currentAvatarEntities.keys()) { for (auto& avatarEntityID : currentAvatarEntities.keys()) {
if (newAvatarEntities.find(avatarEntityID) == newAvatarEntities.end()) { if (newAvatarEntities.find(avatarEntityID) == newAvatarEntities.end()) {
myAvatar->removeAvatarEntity(avatarEntityID); myAvatar->removeWornAvatarEntity(avatarEntityID);
} }
} }
} }
@ -197,7 +197,7 @@ void AvatarBookmarks::loadBookmark(const QString& bookmarkName) {
auto myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar(); auto myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
auto treeRenderer = DependencyManager::get<EntityTreeRenderer>(); auto treeRenderer = DependencyManager::get<EntityTreeRenderer>();
EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr; EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr;
myAvatar->clearAvatarEntities(); myAvatar->clearWornAvatarEntities();
const QString& avatarUrl = bookmark.value(ENTRY_AVATAR_URL, "").toString(); const QString& avatarUrl = bookmark.value(ENTRY_AVATAR_URL, "").toString();
myAvatar->useFullAvatarURL(avatarUrl); myAvatar->useFullAvatarURL(avatarUrl);
qCDebug(interfaceapp) << "Avatar On"; qCDebug(interfaceapp) << "Avatar On";

View file

@ -2372,7 +2372,7 @@ bool isWearableEntity(const EntityItemPointer& entity) {
|| entity->getParentID() == AVATAR_SELF_ID); || entity->getParentID() == AVATAR_SELF_ID);
} }
void MyAvatar::removeAvatarEntity(const EntityItemID& entityID) { void MyAvatar::removeWornAvatarEntity(const EntityItemID& entityID) {
auto treeRenderer = DependencyManager::get<EntityTreeRenderer>(); auto treeRenderer = DependencyManager::get<EntityTreeRenderer>();
EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr; EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr;
@ -2391,13 +2391,13 @@ void MyAvatar::removeAvatarEntity(const EntityItemID& entityID) {
} }
} }
void MyAvatar::clearAvatarEntities() { void MyAvatar::clearWornAvatarEntities() {
QList<QUuid> avatarEntityIDs; QList<QUuid> avatarEntityIDs;
_avatarEntitiesLock.withReadLock([&] { _avatarEntitiesLock.withReadLock([&] {
avatarEntityIDs = _packedAvatarEntityData.keys(); avatarEntityIDs = _packedAvatarEntityData.keys();
}); });
for (auto entityID : avatarEntityIDs) { for (auto entityID : avatarEntityIDs) {
removeAvatarEntity(entityID); removeWornAvatarEntity(entityID);
} }
} }
@ -2803,8 +2803,8 @@ void MyAvatar::setAttachmentData(const QVector<AttachmentData>& attachmentData)
newEntitiesProperties.push_back(properties); newEntitiesProperties.push_back(properties);
} }
// clear any existing avatar entities // clear any existing wearables
clearAvatarEntities(); clearWornAvatarEntities();
for (auto& properties : newEntitiesProperties) { for (auto& properties : newEntitiesProperties) {
DependencyManager::get<EntityScriptingInterface>()->addEntity(properties, true); DependencyManager::get<EntityScriptingInterface>()->addEntity(properties, true);

View file

@ -968,8 +968,8 @@ public:
* @returns {object[]} * @returns {object[]}
*/ */
Q_INVOKABLE QVariantList getAvatarEntitiesVariant(); Q_INVOKABLE QVariantList getAvatarEntitiesVariant();
void removeAvatarEntity(const EntityItemID& entityID); void removeWornAvatarEntity(const EntityItemID& entityID);
void clearAvatarEntities(); void clearWornAvatarEntities();
/**jsdoc /**jsdoc
* Check whether your avatar is flying or not. * Check whether your avatar is flying or not.