Skip to content

Commit 53f82b5

Browse files
committed
Implement ValveSoftware/source-sdk-2013#1323, rename to func_detail_illusionary
1 parent 511ae53 commit 53f82b5

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

sp/src/utils/common/map_shared.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ ChunkFileResult_t LoadEntityKeyCallback(const char *szKey, const char *szValue,
2929
{
3030
pLoadEntity->nBaseContents = CONTENTS_DETAIL;
3131
}
32+
else if (!stricmp(szValue, "func_detail_illusionary"))
33+
{
34+
pLoadEntity->nBaseContents = CONTENTS_DETAIL | CONTENTS_OPAQUE;
35+
}
3236
else if (!stricmp(szValue, "func_ladder"))
3337
{
3438
pLoadEntity->nBaseContents = CONTENTS_LADDER;

sp/src/utils/vbsp/map.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1579,7 +1579,7 @@ ChunkFileResult_t CMapFile::LoadEntityCallback(CChunkFile *pFile, int nParam)
15791579
//
15801580
const char *pClassName = ValueForKey( mapent, "classname" );
15811581

1582-
if ( !strcmp( "func_detail", pClassName ) )
1582+
if ( !strcmp( "func_detail", pClassName ) || !strcmp( "func_detail_illusionary", pClassName ) )
15831583
{
15841584
MoveBrushesToWorld (mapent);
15851585
mapent->numbrushes = 0;
@@ -2609,6 +2609,18 @@ bool LoadMapFile( const char *pszFileName )
26092609
AddPointToBounds (g_LoadingMap->mapbrushes[i].maxs, g_LoadingMap->map_mins, g_LoadingMap->map_maxs);
26102610
}
26112611

2612+
// CONTENTS_OPAQUE makes a brush not solid, but CONTENTS_WINDOW breaks its non-solidity
2613+
// CONTENTS_OPAQUE only gets applied via %compilenonsolid VMT property and func_detail_illusionary entity
2614+
// %compilenonsolid prevents CONTENTS_WINDOW from being applied, func_detail_illusionary does not, so we remove it here
2615+
for (int i = 0; i < g_LoadingMap->entities[0].numbrushes; i++)
2616+
{
2617+
mapbrush_t* brush = &g_LoadingMap->mapbrushes[i];
2618+
if ((brush->contents & CONTENTS_OPAQUE) && (brush->contents & CONTENTS_WINDOW))
2619+
{
2620+
brush->contents &= ~CONTENTS_WINDOW;
2621+
}
2622+
}
2623+
26122624
qprintf ("%5i brushes\n", g_LoadingMap->nummapbrushes);
26132625
qprintf ("%5i clipbrushes\n", g_LoadingMap->c_clipbrushes);
26142626
qprintf ("%5i total sides\n", g_LoadingMap->nummapbrushsides);

0 commit comments

Comments
 (0)