From 2dcfe1a8d0e052ed638e049c7596efc4c8b8bdcd Mon Sep 17 00:00:00 2001 From: snake-biscuits <36507175+snake-biscuits@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:34:22 +1000 Subject: [PATCH] bsp Model `GridCell`'s `.first_geo_set` was being set incorrectly --- src/main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 3f18819..846a8f6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -301,13 +301,16 @@ void addPropsToCmGrid( uint32_t numBspModels = r1bsp.get_lump_length(titanfall::MODELS) / 32; for (uint32_t i = 0; i < numBspModels; i++) { titanfall::GridCell r1GridCell = r1GridCells[numWorldspawnGridCells + i]; + titanfall::GridCell r2GridCell; + // copy GeoSets from r1 + r2GridCell.first_geo_set = static_cast(r2GeoSets.size()); + r2GridCell.num_geo_sets = r1GridCell.num_geo_sets; for (uint32_t j = 0; j < r1GridCell.num_geo_sets; j++) { r2GeoSets.push_back(r1GeoSets[r1GridCell.first_geo_set + j]); r2GeoSetBounds.push_back(r1GeoSetBounds[r1GridCell.first_geo_set + j]); } - r1GridCell.first_geo_set = static_cast(r2GeoSets.size()); - r2GridCells.push_back(r1GridCell); + r2GridCells.push_back(r2GridCell); } // check GeoSets limit