qbsp: fix nonsolid bmodels in hul1/2
This commit is contained in:
parent
61f2bd84cf
commit
b81b52da5a
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"))
|
||||
|
|
|
|||
Loading…
Reference in New Issue