when an avatar-entity's lifetime expires, remove it from avatarEntityData

This commit is contained in:
Seth Alves 2017-12-18 14:26:25 -08:00
parent affd67d7d4
commit ddbb7a4416

View file

@ -1496,6 +1496,14 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
}
});
connect(getEntities()->getTree().get(), &EntityTree::deletingEntity, [=](const EntityItemID& entityItemID) {
auto avatarManager = DependencyManager::get<AvatarManager>();
auto myAvatar = avatarManager ? avatarManager->getMyAvatar() : nullptr;
if (myAvatar) {
myAvatar->clearAvatarEntity(entityItemID);
}
});
// Keyboard focus handling for Web overlays.
auto overlays = &(qApp->getOverlays());
connect(overlays, &Overlays::overlayDeleted, [=](const OverlayID& overlayID) {