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 7d9138d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/ecs/query/filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ void QueryFilter::update()

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

0 comments on commit 7d9138d

Please sign in to comment.