diff --git a/qbsp/brush.cc b/qbsp/brush.cc index 1205b6e9..f5f383db 100644 --- a/qbsp/brush.cc +++ b/qbsp/brush.cc @@ -789,14 +789,14 @@ static void Brush_LoadEntity(mapentity_t &dst, mapentity_t &src, hull_index_t hu if (hullnum.value_or(0)) { /* nonsolid brushes don't show up in clipping hulls */ - if (!contents.is_any_solid(qbsp_options.target_game) && !contents.is_sky(qbsp_options.target_game)) { + if (!contents.is_any_solid(qbsp_options.target_game) + && !contents.is_sky(qbsp_options.target_game) + && !contents.is_fence(qbsp_options.target_game)) { continue; } - /* sky brushes are solid in the collision hulls */ - if (contents.is_sky(qbsp_options.target_game)) { - contents = qbsp_options.target_game->create_solid_contents(); - } + /* all used brushes are solid in the collision hulls */ + contents = qbsp_options.target_game->create_solid_contents(); } // fixme-brushbsp: function calls above can override the values below diff --git a/tests/test_qbsp.cc b/tests/test_qbsp.cc index 4373a785..429ca765 100644 --- a/tests/test_qbsp.cc +++ b/tests/test_qbsp.cc @@ -833,6 +833,16 @@ TEST_CASE("qbsp_bmodel_mirrorinside_with_liquid" * doctest::test_suite("testmaps CHECK(2 == BSP_FindFacesAtPoint(&bsp, &bsp.dmodels[1], model1_fenceface).size()); CHECK(2 == BSP_FindFacesAtPoint(&bsp, &bsp.dmodels[2], model2_waterface).size()); + + // both bmodels should be CONTENTS_SOLID in all hulls + for (int model_idx = 1; model_idx <= 2; ++model_idx) { + for (int hull = 0; hull <= 2; ++hull) { + auto &model = bsp.dmodels[model_idx]; + + INFO("model: ", model_idx, " hull: ", hull); + CHECK(CONTENTS_SOLID == BSP_FindContentsAtPoint(&bsp, {hull}, &model, (model.mins + model.maxs) / 2)); + } + } } TEST_CASE("noclipfaces" * doctest::test_suite("testmaps_q1"))