mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 02:24:51 +02:00
make sure that the root node always appends an entity count (even if it's zero). This keeps the unreasonably-deep-recursion warnings from happening
This commit is contained in:
parent
0b4d4c24d4
commit
c1668553fd
1 changed files with 7 additions and 2 deletions
|
@ -350,6 +350,8 @@ OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// we we couldn't add the entity count, then we couldn't add anything for this element and we're in a NONE state
|
// we we couldn't add the entity count, then we couldn't add anything for this element and we're in a NONE state
|
||||||
|
if (this == _myTree->getRoot())
|
||||||
|
qDebug() << "OctreeElement::NONE 0";;
|
||||||
appendElementState = OctreeElement::NONE;
|
appendElementState = OctreeElement::NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -392,17 +394,20 @@ OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData
|
||||||
|
|
||||||
// If we wrote fewer entities than we expected, update the number of entities in our packet
|
// If we wrote fewer entities than we expected, update the number of entities in our packet
|
||||||
bool successUpdateEntityCount = true;
|
bool successUpdateEntityCount = true;
|
||||||
if (!noEntitiesFit && numberOfEntities != actualNumberOfEntities) {
|
if (numberOfEntities != actualNumberOfEntities) {
|
||||||
successUpdateEntityCount = packetData->updatePriorBytes(numberOfEntitiesOffset,
|
successUpdateEntityCount = packetData->updatePriorBytes(numberOfEntitiesOffset,
|
||||||
(const unsigned char*)&actualNumberOfEntities, sizeof(actualNumberOfEntities));
|
(const unsigned char*)&actualNumberOfEntities, sizeof(actualNumberOfEntities));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we weren't able to update our entity count, or we couldn't fit any entities, then
|
// If we weren't able to update our entity count, or we couldn't fit any entities, then
|
||||||
// we should discard our element and return a result of NONE
|
// we should discard our element and return a result of NONE
|
||||||
if (!successUpdateEntityCount || noEntitiesFit) {
|
if (!successUpdateEntityCount) {
|
||||||
packetData->discardLevel(elementLevel);
|
packetData->discardLevel(elementLevel);
|
||||||
appendElementState = OctreeElement::NONE;
|
appendElementState = OctreeElement::NONE;
|
||||||
} else {
|
} else {
|
||||||
|
if (noEntitiesFit) {
|
||||||
|
appendElementState = OctreeElement::PARTIAL;
|
||||||
|
}
|
||||||
packetData->endLevel(elementLevel);
|
packetData->endLevel(elementLevel);
|
||||||
}
|
}
|
||||||
return appendElementState;
|
return appendElementState;
|
||||||
|
|
Loading…
Reference in a new issue