Remove loading-orb upon killing avatar, in case destructor isn't called

This commit is contained in:
Simon Walton 2019-07-15 14:14:24 -07:00
parent d37456ea31
commit e259aa55c2
2 changed files with 2 additions and 0 deletions

View file

@ -574,6 +574,7 @@ void AvatarManager::handleRemovedAvatar(const AvatarSharedPointer& removedAvatar
avatar->die();
queuePhysicsChange(avatar);
avatar->removeOrb();
// remove this avatar's entities from the tree now, if we wait (as we did previously) for this Avatar's destructor
// it might not fire until after we create a new instance for the same remote avatar, which creates a race

View file

@ -75,6 +75,7 @@ void OtherAvatar::createOrb() {
properties.setType(EntityTypes::Sphere);
properties.setAlpha(1.0f);
properties.setColor(getLoadingOrbColor(_loadingStatus));
properties.setName("Loading Avatar " + getID().toString());
properties.setPrimitiveMode(PrimitiveMode::LINES);
properties.getPulse().setMin(0.5f);
properties.getPulse().setMax(1.0f);