Skip to content

Commit 48cbfe3

Browse files
committed
Restore trace_flags value inside Fun's TraceLine hookThe engine resets the trace_flags value at the end of PF_traceline_DLL. This causes any assigned trace_flags to be overwritten when an additional TraceLine call is made inside the pfnTraceLine hook. If the Fun module is loaded before Fakemeta, plugins cannot catch the gpGlobals->trace_flags value, which now has an important use with ReGameDLL_CS. This behavior directly exposes an old, previously undiscovered bug. Applied from upstream repo: alliedmodders@735928e
1 parent 101c346 commit 48cbfe3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/fun/fun.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,9 @@ int ClientConnect(edict_t *pPlayer, const char *pszName, const char *pszAddress,
484484

485485
void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *shooter, TraceResult *ptr)
486486
{
487+
const auto traceflags = gpGlobals->trace_flags;
487488
TRACE_LINE(v1, v2, fNoMonsters, shooter, ptr);
489+
gpGlobals->trace_flags = traceflags;
488490

489491
if (ptr->pHit && (ptr->pHit->v.flags & (FL_CLIENT | FL_FAKECLIENT))
490492
&& shooter && (shooter->v.flags & (FL_CLIENT | FL_FAKECLIENT)) )

0 commit comments

Comments
 (0)