diff --git a/regamedll/common/const.h b/regamedll/common/const.h index 3c9873114..d667a6b85 100644 --- a/regamedll/common/const.h +++ b/regamedll/common/const.h @@ -96,6 +96,11 @@ // Goes into globalvars_t.trace_flags #define FTRACE_SIMPLEBOX BIT(0) // Traceline with a simple box +// Custom flags that we can retrive in pfnShouldCollide +// Starting from BIT(16) to reserve space for more flags for Engine +#define FTRACE_BULLET BIT(16) +#define FTRACE_FLASH BIT(17) + // walkmove modes #define WALKMOVE_NORMAL 0 // normal walkmove #define WALKMOVE_WORLDONLY 1 // doesn't hit ANY entities, no matter what the solid type diff --git a/regamedll/dlls/cbase.cpp b/regamedll/dlls/cbase.cpp index 9bf5abef0..b1cbe149e 100644 --- a/regamedll/dlls/cbase.cpp +++ b/regamedll/dlls/cbase.cpp @@ -1039,6 +1039,9 @@ void CBaseEntity::__API_HOOK(FireBullets)(ULONG cShots, VectorRef vecSrc, Vector vecDir = vecDirShooting + x * vecSpread.x * vecRight + y * vecSpread.y * vecUp; vecEnd = vecSrc + vecDir * flDistance; +#ifdef REGAMEDLL_ADD + gpGlobals->trace_flags = FTRACE_BULLET; +#endif UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, ENT(pev), &tr); tracer = 0; @@ -1182,6 +1185,9 @@ void CBaseEntity::__API_HOOK(FireBuckshots)(ULONG cShots, VectorRef vecSrc, Vect vecDir = vecDirShooting + x * vecSpread.x * vecRight + y * vecSpread.y * vecUp; vecEnd = vecSrc + vecDir * flDistance; +#ifdef REGAMEDLL_ADD + gpGlobals->trace_flags = FTRACE_BULLET; +#endif UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, ENT(pev), &tr); tracer = 0; @@ -1337,6 +1343,10 @@ VectorRef CBaseEntity::__API_HOOK(FireBullets3)(VectorRef vecSrc, VectorRef vecD while (iPenetration != 0) { ClearMultiDamage(); + +#ifdef REGAMEDLL_ADD + gpGlobals->trace_flags = FTRACE_BULLET; +#endif UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, ENT(pev), &tr); if (TheBots && tr.flFraction != 1.0f) diff --git a/regamedll/dlls/combat.cpp b/regamedll/dlls/combat.cpp index f5ec1ce15..620c84cfd 100644 --- a/regamedll/dlls/combat.cpp +++ b/regamedll/dlls/combat.cpp @@ -26,6 +26,9 @@ void PlayerBlind(CBasePlayer *pPlayer, entvars_t *pevInflictor, entvars_t *pevAt void RadiusFlash_TraceLine_hook(CBasePlayer *pPlayer, entvars_t *pevInflictor, entvars_t *pevAttacker, Vector &vecSrc, Vector &vecSpot, TraceResult *tr) { +#ifdef REGAMEDLL_ADD + gpGlobals->trace_flags = FTRACE_FLASH; +#endif UTIL_TraceLine(vecSrc, vecSpot, dont_ignore_monsters, ENT(pevInflictor), tr); }