RadiusFlash: Fixed eyes position

This commit is contained in:
s1lent 2019-08-13 21:38:43 +07:00
parent b9367f087d
commit 0bd5f7a0bb
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
2 changed files with 8 additions and 0 deletions

View File

@ -71,7 +71,13 @@ void RadiusFlash(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker,
if (!bInWater && pPlayer->pev->waterlevel == 3) if (!bInWater && pPlayer->pev->waterlevel == 3)
continue; continue;
#ifdef REGAMEDLL_FIXES
vecSpot = pPlayer->EyePosition();
#else
// NOTE: See CBasePlayer::BodyTarget
vecSpot = pPlayer->BodyTarget(vecSrc); vecSpot = pPlayer->BodyTarget(vecSrc);
#endif
g_ReGameHookchains.m_RadiusFlash_TraceLine.callChain(RadiusFlash_TraceLine_hook, pPlayer, pevInflictor, pevAttacker, vecSrc, vecSpot, &tr); g_ReGameHookchains.m_RadiusFlash_TraceLine.callChain(RadiusFlash_TraceLine_hook, pPlayer, pevInflictor, pevAttacker, vecSrc, vecSpot, &tr);
if (tr.flFraction != 1.0f && tr.pHit != pPlayer->pev->pContainingEntity) if (tr.flFraction != 1.0f && tr.pHit != pPlayer->pev->pContainingEntity)

View File

@ -358,6 +358,8 @@ public:
virtual BOOL IsNetClient() { return TRUE; } virtual BOOL IsNetClient() { return TRUE; }
virtual const char *TeamID(); virtual const char *TeamID();
virtual BOOL FBecomeProne(); virtual BOOL FBecomeProne();
// TODO: Need to investigate for what purposes used random to get relative eyes position
virtual Vector BodyTarget(const Vector &posSrc) { return Center() + pev->view_ofs * RANDOM_FLOAT(0.5, 1.1); } virtual Vector BodyTarget(const Vector &posSrc) { return Center() + pev->view_ofs * RANDOM_FLOAT(0.5, 1.1); }
virtual int Illumination(); virtual int Illumination();
virtual BOOL ShouldFadeOnDeath() { return FALSE; } virtual BOOL ShouldFadeOnDeath() { return FALSE; }