2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-05-25 02:51:43 +00:00

fix: account for possible zero items when building aabb trees

This commit is contained in:
Jan Laupetin
2026-05-24 01:03:09 +02:00
parent 64d518405d
commit a81548e300
@@ -662,7 +662,7 @@ namespace xmodel
options.maxs[leafIndex][2] = bounds.m_maxs.z(); options.maxs[leafIndex][2] = bounds.m_maxs.z();
} }
const auto nodeCount = aabbTreeBuilder.BuildAabbTree(&options); const auto nodeCount = options.itemCount > 0 ? aabbTreeBuilder.BuildAabbTree(&options) : 0;
tree->nodes.resize(nodeCount); tree->nodes.resize(nodeCount);
for (auto nodeIndex = 0; nodeIndex < nodeCount; ++nodeIndex) for (auto nodeIndex = 0; nodeIndex < nodeCount; ++nodeIndex)