mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-28 15:45:41 +03:00
add FTRACE_KNIFE flag (#817)
* trace flags * remove unused flags * add FTRACE_KNIFE flag
This commit is contained in:
parent
6da11fa4dd
commit
e1d1c11992
@ -100,6 +100,7 @@
|
||||
// Starting from BIT(16) to reserve space for more flags for Engine
|
||||
#define FTRACE_BULLET BIT(16)
|
||||
#define FTRACE_FLASH BIT(17)
|
||||
#define FTRACE_KNIFE BIT(18)
|
||||
|
||||
// walkmove modes
|
||||
#define WALKMOVE_NORMAL 0 // normal walkmove
|
||||
|
@ -129,6 +129,9 @@ void FindHullIntersection(const Vector &vecSrc, TraceResult &tr, float *mins, fl
|
||||
distance = 1e6f;
|
||||
|
||||
vecHullEnd = vecSrc + ((vecHullEnd - vecSrc) * 2);
|
||||
#ifdef REGAMEDLL_ADD
|
||||
gpGlobals->trace_flags = FTRACE_KNIFE;
|
||||
#endif
|
||||
UTIL_TraceLine(vecSrc, vecHullEnd, dont_ignore_monsters, pEntity, &tmpTrace);
|
||||
|
||||
if (tmpTrace.flFraction < 1.0f)
|
||||
@ -147,6 +150,9 @@ void FindHullIntersection(const Vector &vecSrc, TraceResult &tr, float *mins, fl
|
||||
vecEnd.y = vecHullEnd.y + minmaxs[j][1];
|
||||
vecEnd.z = vecHullEnd.z + minmaxs[k][2];
|
||||
|
||||
#ifdef REGAMEDLL_ADD
|
||||
gpGlobals->trace_flags = FTRACE_KNIFE;
|
||||
#endif
|
||||
UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, pEntity, &tmpTrace);
|
||||
|
||||
if (tmpTrace.flFraction < 1.0f)
|
||||
@ -274,11 +280,21 @@ BOOL CKnife::Swing(BOOL fFirst)
|
||||
vecSrc = m_pPlayer->GetGunPosition();
|
||||
vecEnd = vecSrc + gpGlobals->v_forward * KnifeSwingDistance();
|
||||
|
||||
#ifdef REGAMEDLL_ADD
|
||||
gpGlobals->trace_flags = FTRACE_KNIFE;
|
||||
#endif
|
||||
UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, m_pPlayer->edict(), &tr);
|
||||
|
||||
if (tr.flFraction >= 1.0f)
|
||||
{
|
||||
#ifdef REGAMEDLL_ADD
|
||||
gpGlobals->trace_flags = FTRACE_KNIFE;
|
||||
#endif
|
||||
UTIL_TraceHull(vecSrc, vecEnd, dont_ignore_monsters, head_hull, m_pPlayer->edict(), &tr);
|
||||
#ifdef REGAMEDLL_ADD
|
||||
// We manually reset it because Engine doesn't unlike TraceLine
|
||||
gpGlobals->trace_flags = 0;
|
||||
#endif
|
||||
|
||||
if (tr.flFraction < 1.0f)
|
||||
{
|
||||
@ -457,11 +473,21 @@ BOOL CKnife::Stab(BOOL fFirst)
|
||||
vecSrc = m_pPlayer->GetGunPosition();
|
||||
vecEnd = vecSrc + gpGlobals->v_forward * KnifeStabDistance();
|
||||
|
||||
#ifdef REGAMEDLL_ADD
|
||||
gpGlobals->trace_flags = FTRACE_KNIFE;
|
||||
#endif
|
||||
UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, m_pPlayer->edict(), &tr);
|
||||
|
||||
if (tr.flFraction >= 1.0f)
|
||||
{
|
||||
#ifdef REGAMEDLL_ADD
|
||||
gpGlobals->trace_flags = FTRACE_KNIFE;
|
||||
#endif
|
||||
UTIL_TraceHull(vecSrc, vecEnd, dont_ignore_monsters, head_hull, m_pPlayer->edict(), &tr);
|
||||
#ifdef REGAMEDLL_ADD
|
||||
// We manually reset it because Engine doesn't unlike TraceLine
|
||||
gpGlobals->trace_flags = 0;
|
||||
#endif
|
||||
|
||||
if (tr.flFraction < 1.0f)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user