Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
trace flags
  • Loading branch information
hamdi2050 committed Mar 5, 2023
commit d70958598a77d06482f352e285110f91e3711552
8 changes: 8 additions & 0 deletions regamedll/common/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@

// Goes into globalvars_t.trace_flags
#define FTRACE_SIMPLEBOX BIT(0) // Traceline with a simple box
// Custom flags that we can retrive in pfnShouldCollide
#define FTRACE_PUSH_ENTITY BIT(1)
#define FTRACE_PHYSICS_STEP BIT(2)
#define FTRACE_TOSS BIT(3)

// 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
Expand Down
10 changes: 10 additions & 0 deletions regamedll/dlls/cbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions regamedll/dlls/combat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down