From 455f8ee3ce488a8c1bf74887c996f80438cfc0be Mon Sep 17 00:00:00 2001 From: Gamer_X Date: Sun, 1 Jun 2025 13:28:52 +0300 Subject: [PATCH 1/2] add func_detail_nosolid --- src/utils/common/map_shared.cpp | 4 ++++ src/utils/vbsp/map.cpp | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/utils/common/map_shared.cpp b/src/utils/common/map_shared.cpp index e33e20cbf1d..5fd70afbb0c 100644 --- a/src/utils/common/map_shared.cpp +++ b/src/utils/common/map_shared.cpp @@ -29,6 +29,10 @@ ChunkFileResult_t LoadEntityKeyCallback(const char *szKey, const char *szValue, { pLoadEntity->nBaseContents = CONTENTS_DETAIL; } + else if (!stricmp( szValue, "func_detail_nosolid")) + { + pLoadEntity->nBaseContents = CONTENTS_DETAIL | CONTENTS_OPAQUE; + } else if (!stricmp(szValue, "func_ladder")) { pLoadEntity->nBaseContents = CONTENTS_LADDER; diff --git a/src/utils/vbsp/map.cpp b/src/utils/vbsp/map.cpp index d39a2d72716..18429ed870e 100644 --- a/src/utils/vbsp/map.cpp +++ b/src/utils/vbsp/map.cpp @@ -1579,7 +1579,7 @@ ChunkFileResult_t CMapFile::LoadEntityCallback(CChunkFile *pFile, int nParam) // const char *pClassName = ValueForKey( mapent, "classname" ); - if ( !strcmp( "func_detail", pClassName ) ) + if ( !strcmp( "func_detail", pClassName ) || !strcmp( "func_detail_nosolid", pClassName ) ) { MoveBrushesToWorld (mapent); mapent->numbrushes = 0; @@ -2644,6 +2644,18 @@ bool LoadMapFile( const char *pszFileName ) AddPointToBounds (g_LoadingMap->mapbrushes[i].maxs, g_LoadingMap->map_mins, g_LoadingMap->map_maxs); } + // CONTENTS_OPAQUE makes a brush not solid, but CONTENTS_WINDOW breaks its non-solidity + // CONTENTS_OPAQUE only gets applied via %compilenonsolid VMT property and func_detail_nosolid entity + // %compilenonsolid prevents CONTENTS_WINDOW from being applied, func_detail_nosolid does not, so we remove it here + for ( int i = 0; i < g_LoadingMap->entities[0].numbrushes; i++ ) + { + mapbrush_t* brush = &g_LoadingMap->mapbrushes[i]; + if ( ( brush->contents & CONTENTS_OPAQUE ) && ( brush->contents & CONTENTS_WINDOW ) ) + { + brush->contents &= ~CONTENTS_WINDOW; + } + } + qprintf ("%5i brushes\n", g_LoadingMap->nummapbrushes); qprintf ("%5i clipbrushes\n", g_LoadingMap->c_clipbrushes); qprintf ("%5i total sides\n", g_LoadingMap->nummapbrushsides); From 30e576bc514106798bee7c15d857da858997c2a0 Mon Sep 17 00:00:00 2001 From: Gamer_X Date: Sun, 1 Jun 2025 13:57:16 +0300 Subject: [PATCH 2/2] rename to func_detail_nonsolid to match %compilenonsolid --- src/utils/common/map_shared.cpp | 2 +- src/utils/vbsp/map.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/common/map_shared.cpp b/src/utils/common/map_shared.cpp index 5fd70afbb0c..6c9329190b4 100644 --- a/src/utils/common/map_shared.cpp +++ b/src/utils/common/map_shared.cpp @@ -29,7 +29,7 @@ ChunkFileResult_t LoadEntityKeyCallback(const char *szKey, const char *szValue, { pLoadEntity->nBaseContents = CONTENTS_DETAIL; } - else if (!stricmp( szValue, "func_detail_nosolid")) + else if (!stricmp( szValue, "func_detail_nonsolid")) { pLoadEntity->nBaseContents = CONTENTS_DETAIL | CONTENTS_OPAQUE; } diff --git a/src/utils/vbsp/map.cpp b/src/utils/vbsp/map.cpp index 18429ed870e..b133dc92260 100644 --- a/src/utils/vbsp/map.cpp +++ b/src/utils/vbsp/map.cpp @@ -1579,7 +1579,7 @@ ChunkFileResult_t CMapFile::LoadEntityCallback(CChunkFile *pFile, int nParam) // const char *pClassName = ValueForKey( mapent, "classname" ); - if ( !strcmp( "func_detail", pClassName ) || !strcmp( "func_detail_nosolid", pClassName ) ) + if ( !strcmp( "func_detail", pClassName ) || !strcmp( "func_detail_nonsolid", pClassName ) ) { MoveBrushesToWorld (mapent); mapent->numbrushes = 0; @@ -2645,8 +2645,8 @@ bool LoadMapFile( const char *pszFileName ) } // CONTENTS_OPAQUE makes a brush not solid, but CONTENTS_WINDOW breaks its non-solidity - // CONTENTS_OPAQUE only gets applied via %compilenonsolid VMT property and func_detail_nosolid entity - // %compilenonsolid prevents CONTENTS_WINDOW from being applied, func_detail_nosolid does not, so we remove it here + // CONTENTS_OPAQUE only gets applied via %compilenonsolid VMT property and func_detail_nonsolid entity + // %compilenonsolid prevents CONTENTS_WINDOW from being applied, func_detail_nonsolid does not, so we remove it here for ( int i = 0; i < g_LoadingMap->entities[0].numbrushes; i++ ) { mapbrush_t* brush = &g_LoadingMap->mapbrushes[i];