Skip to content

Commit

Permalink
fix(ecs): add assert for QueryFilter::update to avoid compiler error
Browse files Browse the repository at this point in the history
  • Loading branch information
SrGesus committed Oct 22, 2024
1 parent 86781d5 commit 75eb5bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/ecs/query/filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ void QueryFilter::update()

// Update the pin masks with which each node will run.
mNodePins[0] = 0;
for (int i = 1; i < mNodeCount; ++i)
// Copy mNodeCount since the compiler thinks it will change. See issue #1351
int nodeCount = this->mNodeCount;
CUBOS_ASSERT(nodeCount <= QueryNode::MaxCursorCount);
for (int i = 1; i < nodeCount; ++i)
{
mNodePins[i] = mNodePins[i - 1] | mNodes[i - 1]->pins();
}
Expand Down

0 comments on commit 75eb5bd

Please sign in to comment.