diff --git a/src/utils/common/map_shared.cpp b/src/utils/common/map_shared.cpp index e33e20cbf1..6c9329190b 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_nonsolid")) + { + 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 d39a2d7271..b133dc9226 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_nonsolid", 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_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]; + 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);