mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 15:30:38 +02:00
don't grab the JSON filters for each entity checked
This commit is contained in:
parent
6376068021
commit
67951517b4
1 changed files with 29 additions and 27 deletions
|
@ -284,6 +284,16 @@ OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData
|
|||
// entities for encoding. This is needed because we encode the element data at the "parent" level, and so we
|
||||
// need to handle the case where our sibling elements need encoding but we don't.
|
||||
if (!entityTreeElementExtraEncodeData->elementCompleted) {
|
||||
|
||||
QJsonObject jsonFilters;
|
||||
auto entityNodeData = dynamic_cast<EntityNodeData*>(params.nodeData);
|
||||
|
||||
if (entityNodeData) {
|
||||
// we have an EntityNodeData instance
|
||||
// so we should assume that means we might have JSON filters to check
|
||||
jsonFilters = entityNodeData->getJSONParameters();
|
||||
}
|
||||
|
||||
for (uint16_t i = 0; i < _entityItems.size(); i++) {
|
||||
EntityItemPointer entity = _entityItems[i];
|
||||
bool includeThisEntity = true;
|
||||
|
@ -292,13 +302,6 @@ OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData
|
|||
includeThisEntity = false;
|
||||
}
|
||||
|
||||
auto entityNodeData = dynamic_cast<EntityNodeData*>(params.nodeData);
|
||||
|
||||
if (entityNodeData) {
|
||||
// we have an EntityNodeData instance
|
||||
// so we should assume that means we might have JSON filters to check
|
||||
auto jsonFilters = entityNodeData->getJSONParameters();
|
||||
|
||||
if (!jsonFilters.isEmpty()) {
|
||||
|
||||
// if params include JSON filters, check if this entity matches
|
||||
|
@ -322,7 +325,6 @@ OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hadElementExtraData) {
|
||||
includeThisEntity = includeThisEntity &&
|
||||
|
|
Loading…
Reference in a new issue