diff --git a/qbsp/map.cc b/qbsp/map.cc index b8d61b90..a63b7a2b 100644 --- a/qbsp/map.cc +++ b/qbsp/map.cc @@ -1493,10 +1493,12 @@ static contentflags_t Brush_GetContents(const mapentity_t &entity, const mapbrus } if (string_iequals(entity.epairs.get("classname"), "func_illusionary_visblocker")) { - // unset solid + detail, set mist + // - unset existing visible contents + detail + // - set mist, mirrorinside, mirrorinside set // note this overrides the logic in face_get_contents() that normally forces mist to be detail base_contents = contentflags_t::make( - (base_contents.flags & ~(EWT_VISCONTENTS_SOLID | EWT_CFLAG_DETAIL)) | EWT_VISCONTENTS_MIST); + (base_contents.flags & ~(EWT_ALL_VISIBLE_CONTENTS | EWT_CFLAG_DETAIL)) + | (EWT_VISCONTENTS_MIST | EWT_CFLAG_MIRROR_INSIDE | EWT_CFLAG_MIRROR_INSIDE_SET)); } // non-Q2: -transwater implies liquids are detail diff --git a/testmaps/q1_func_illusionary_visblocker.map b/testmaps/q1_func_illusionary_visblocker.map index a84a6bd4..372be8ee 100644 --- a/testmaps/q1_func_illusionary_visblocker.map +++ b/testmaps/q1_func_illusionary_visblocker.map @@ -92,14 +92,13 @@ // entity 3 { "classname" "func_illusionary_visblocker" -"_mirrorinside" "1" // brush 0 { -( -64 80 16 ) ( -64 81 16 ) ( -64 80 17 ) {trigger 0 0 0 1 1 -( -64 -16 16 ) ( -64 -16 17 ) ( -63 -16 16 ) {trigger 0 0 0 1 1 -( -64 80 16 ) ( -63 80 16 ) ( -64 81 16 ) {trigger 0 0 0 1 1 -( 176 128 240 ) ( 176 129 240 ) ( 177 128 240 ) {trigger 0 0 0 1 1 -( 176 16 32 ) ( 177 16 32 ) ( 176 16 33 ) {trigger 0 0 0 1 1 -( 176 128 32 ) ( 176 128 33 ) ( 176 129 32 ) {trigger 0 0 0 1 1 +( -64 80 16 ) ( -64 81 16 ) ( -64 80 17 ) *zwater1 0 0 0 1 1 +( -64 -16 16 ) ( -64 -16 17 ) ( -63 -16 16 ) *zwater1 0 0 0 1 1 +( -64 80 16 ) ( -63 80 16 ) ( -64 81 16 ) *zwater1 0 0 0 1 1 +( 176 128 240 ) ( 176 129 240 ) ( 177 128 240 ) *zwater1 0 0 0 1 1 +( 176 16 32 ) ( 177 16 32 ) ( 176 16 33 ) *zwater1 0 0 0 1 1 +( 176 128 32 ) ( 176 128 33 ) ( 176 129 32 ) *zwater1 0 0 0 1 1 } } diff --git a/tests/test_vis.cc b/tests/test_vis.cc index 923bb331..51a8c901 100644 --- a/tests/test_vis.cc +++ b/tests/test_vis.cc @@ -106,9 +106,9 @@ TEST(vis, q1FuncIllusionaryVisblocker) { auto [bsp, bspx, lit] = QbspVisLight_Q1("q1_func_illusionary_visblocker.map", {}, runvis_t::yes); - // should export a face - auto *face = BSP_FindFaceAtPoint(&bsp, &bsp.dmodels[0], {80, 16, 96}, {0, 1, 0}); - ASSERT_TRUE(face); + // func_illusionary_visblocker is 2 sided by default + EXPECT_TRUE(BSP_FindFaceAtPoint(&bsp, &bsp.dmodels[0], {80, 16, 96}, {0, 1, 0})); + EXPECT_TRUE(BSP_FindFaceAtPoint(&bsp, &bsp.dmodels[0], {80, 16, 96}, {0, -1, 0})); const auto vis = DecompressAllVis(&bsp); @@ -126,6 +126,7 @@ TEST(vis, q1FuncIllusionaryVisblocker) EXPECT_EQ(item_enviro_leaf->contents, CONTENTS_EMPTY); EXPECT_EQ(player_start_leaf->contents, CONTENTS_EMPTY); + // water brush inside func_illusionary_visblocker gets converted to empty EXPECT_EQ(in_visblocker_leaf->contents, CONTENTS_EMPTY); // check visdata