try harder to not do simple-simulation on things that have an avatar ancestor

This commit is contained in:
Seth Alves 2016-06-08 13:47:52 -07:00
parent a1766539f4
commit d7fc789ea7

View file

@ -261,11 +261,14 @@ void EntitySimulation::moveSimpleKinematics(const quint64& now) {
SetOfEntities::iterator itemItr = _simpleKinematicEntities.begin();
while (itemItr != _simpleKinematicEntities.end()) {
EntityItemPointer entity = *itemItr;
if (entity->isMovingRelativeToParent() &&
!entity->getPhysicsInfo() &&
// The entity-server doesn't know where avatars are, so don't attempt to do simple extrapolation for
// children of avatars.
!entity->hasAncestorOfType(NestableType::Avatar)) {
// The entity-server doesn't know where avatars are, so don't attempt to do simple extrapolation for
// children of avatars.
bool ancestryIsKnown;
entity->getMaximumAACube(ancestryIsKnown);
bool hasAvatarAncestor = entity->hasAncestorOfType(NestableType::Avatar);
if (entity->isMovingRelativeToParent() && !entity->getPhysicsInfo() && ancestryIsKnown && !hasAvatarAncestor) {
entity->simulate(now);
_entitiesToSort.insert(entity);
++itemItr;