mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-22 21:45:04 +02:00
don't update server for AvatarEntity queryAACube
This commit is contained in:
parent
9ea6968e35
commit
0098dedcbb
1 changed files with 22 additions and 19 deletions
|
@ -2964,27 +2964,30 @@ void EntityTree::updateEntityQueryAACubeWorker(SpatiallyNestablePointer object,
|
||||||
MovingEntitiesOperator& moveOperator, bool force, bool tellServer) {
|
MovingEntitiesOperator& moveOperator, bool force, bool tellServer) {
|
||||||
// if the queryBox has changed, tell the entity-server
|
// if the queryBox has changed, tell the entity-server
|
||||||
EntityItemPointer entity = std::dynamic_pointer_cast<EntityItem>(object);
|
EntityItemPointer entity = std::dynamic_pointer_cast<EntityItem>(object);
|
||||||
if (entity && (entity->updateQueryAACube() || force)) {
|
if (entity) {
|
||||||
bool success;
|
bool tellServerThis = tellServer && (entity->getEntityHostType() != entity::HostType::AVATAR);
|
||||||
AACube newCube = entity->getQueryAACube(success);
|
if ((entity->updateQueryAACube() || force)) {
|
||||||
if (success) {
|
bool success;
|
||||||
moveOperator.addEntityToMoveList(entity, newCube);
|
AACube newCube = entity->getQueryAACube(success);
|
||||||
}
|
if (success) {
|
||||||
// send an edit packet to update the entity-server about the queryAABox. We do this for domain-hosted
|
moveOperator.addEntityToMoveList(entity, newCube);
|
||||||
// entities as well as for avatar-entities; the packet-sender will route the update accordingly
|
}
|
||||||
if (tellServer && packetSender && (entity->isDomainEntity() || entity->isAvatarEntity())) {
|
// send an edit packet to update the entity-server about the queryAABox. We do this for domain-hosted
|
||||||
quint64 now = usecTimestampNow();
|
// entities as well as for avatar-entities; the packet-sender will route the update accordingly
|
||||||
EntityItemProperties properties = entity->getProperties();
|
if (tellServerThis && packetSender && (entity->isDomainEntity() || entity->isAvatarEntity())) {
|
||||||
properties.setQueryAACubeDirty();
|
quint64 now = usecTimestampNow();
|
||||||
properties.setLocationDirty();
|
EntityItemProperties properties = entity->getProperties();
|
||||||
properties.setLastEdited(now);
|
properties.setQueryAACubeDirty();
|
||||||
|
properties.setLocationDirty();
|
||||||
|
properties.setLastEdited(now);
|
||||||
|
|
||||||
packetSender->queueEditEntityMessage(PacketType::EntityEdit, getThisPointer(), entity->getID(), properties);
|
packetSender->queueEditEntityMessage(PacketType::EntityEdit, getThisPointer(), entity->getID(), properties);
|
||||||
entity->setLastBroadcast(now); // for debug/physics status icons
|
entity->setLastBroadcast(now); // for debug/physics status icons
|
||||||
}
|
}
|
||||||
|
|
||||||
entity->markDirtyFlags(Simulation::DIRTY_POSITION);
|
entity->markDirtyFlags(Simulation::DIRTY_POSITION);
|
||||||
entityChanged(entity);
|
entityChanged(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
object->forEachDescendant([&](SpatiallyNestablePointer descendant) {
|
object->forEachDescendant([&](SpatiallyNestablePointer descendant) {
|
||||||
|
|
Loading…
Reference in a new issue