Revert "TODO: figure out why we need to do this"

This reverts commit 53561ff881.
This commit is contained in:
Kamay Xutax 2024-09-05 01:58:30 +02:00
parent 84672b5c24
commit d40a479e85
10 changed files with 30 additions and 80 deletions

View file

@ -690,7 +690,6 @@ IMPLEMENT_CLIENTCLASS_DT( C_CSPlayer, DT_CSPlayer, CCSPlayer )
RecvPropInt( RECVINFO( m_iClass ) ),
RecvPropInt( RECVINFO( m_ArmorValue ) ),
RecvPropQAngles( RECVINFO( m_angEyeAngles ) ),
RecvPropQAngles( RECVINFO( m_angRenderAngles ) ),
RecvPropFloat( RECVINFO( m_flStamina ) ),
RecvPropInt( RECVINFO( m_bHasDefuser ), 0, RecvProxy_HasDefuser ),
RecvPropInt( RECVINFO( m_bNightVisionOn), 0, RecvProxy_NightVision ),
@ -739,8 +738,6 @@ C_CSPlayer::C_CSPlayer() :
AddVar( &m_angEyeAngles, &m_iv_angEyeAngles, LATCH_SIMULATION_VAR );
// interpolation on m_angRenderAngles later
m_iLastAddonBits = m_iAddonBits = 0;
m_iLastPrimaryAddon = m_iLastSecondaryAddon = WEAPON_NONE;
m_iProgressBarDuration = 0;
@ -882,6 +879,19 @@ int C_CSPlayer::GetCurrentAssaultSuitPrice()
}
}
const QAngle& C_CSPlayer::GetRenderAngles()
{
if ( IsRagdoll() )
{
return vec3_angle;
}
else
{
return BaseClass::GetRenderAngles();
}
}
float g_flFattenAmt = 4;
void C_CSPlayer::GetShadowRenderBounds( Vector &mins, Vector &maxs, ShadowType_t shadowType )
{
@ -2170,7 +2180,7 @@ void C_CSPlayer::FireGameEvent( IGameEvent* event )
C_AnimationLayer backupAnimLayers[C_BaseAnimatingOverlay::MAX_OVERLAYS];
Vector vecBackupPosition = player->GetAbsOrigin();
QAngle angBackupAngles = player->GetRenderAngles();
QAngle angBackupAngles = player->GetAbsAngles();
auto flOldCycle = player->GetCycle();
auto iOldSequence = player->GetSequence();
@ -2195,9 +2205,9 @@ void C_CSPlayer::FireGameEvent( IGameEvent* event )
event->GetFloat( "position_y" ),
event->GetFloat( "position_z" ) ) );
player->m_angRenderAngles = QAngle( event->GetFloat( "angle_x" ),
event->GetFloat( "angle_y" ),
event->GetFloat( "angle_z" ) );
player->SetAbsAngles( QAngle( event->GetFloat( "angle_x" ),
event->GetFloat( "angle_y" ),
event->GetFloat( "angle_z" ) ) );
const auto numposeparams = event->GetInt( "num_poseparams" );
Assert( numposeparams == player->GetModelPtr()->GetNumPoseParameters() );
@ -2301,7 +2311,7 @@ void C_CSPlayer::FireGameEvent( IGameEvent* event )
pos++;
}
auto angles = player->GetRenderAngles();
auto angles = player->GetAbsAngles();
if ( pRecord->m_angAbsRotation != angles )
{
@ -2430,7 +2440,7 @@ void C_CSPlayer::FireGameEvent( IGameEvent* event )
player->m_nSequence = iOldSequence;
player->m_flCycle = flOldCycle;
player->SetAbsOrigin( vecBackupPosition );
player->m_angRenderAngles = angBackupAngles;
player->SetAbsAngles( angBackupAngles );
for ( int i = 0; i < MAXSTUDIOPOSEPARAM; i++ )
{

View file

@ -6,7 +6,6 @@
#ifndef C_CS_PLAYER_H
#define C_CS_PLAYER_H
#include "mathlib/vector.h"
#ifdef _WIN32
#pragma once
#endif
@ -421,8 +420,6 @@ private:
};
CUtlCircularBuffer< HitboxRecord, MAX_HISTORY_HITBOX_RECORDS > m_HitboxTrack[MAX_PLAYERS + 1];
QAngle m_angRenderAngles;
};
C_CSPlayer* GetLocalOrInEyeCSPlayer( void );

View file

@ -480,7 +480,7 @@ void CBaseAnimatingOverlay::GetSkeleton( CStudioHdr *pStudioHdr, Vector pos[], Q
if ( m_pIk )
{
CIKContext auto_ik;
auto_ik.Init( pStudioHdr, GetRenderAngles(), GetAbsOrigin(), gpGlobals->curtime, m_iIKCounter, boneMask );
auto_ik.Init( pStudioHdr, GetAbsAngles(), GetAbsOrigin(), gpGlobals->curtime, m_iIKCounter, boneMask );
boneSetup.CalcAutoplaySequences( pos, q, gpGlobals->curtime, &auto_ik );
}
else

View file

@ -1670,7 +1670,7 @@ void CBaseAnimating::CalculateIKLocks( float currentTime )
// FIXME: trace based on gravity or trace based on angles?
Vector up;
AngleVectors( GetRenderAngles(), NULL, NULL, &up );
AngleVectors( GetAbsAngles(), NULL, NULL, &up );
// FIXME: check number of slots?
float minHeight = FLT_MAX;
@ -1781,7 +1781,7 @@ void CBaseAnimating::CalculateIKLocks( float currentTime )
else if (trace.DidHitNonWorldEntity())
{
pTarget->SetPos( trace.endpos );
pTarget->SetAngles( GetRenderAngles() );
pTarget->SetAngles( GetAbsAngles() );
// only do this on forward tracking or commited IK ground rules
if (pTarget->est.release < 0.1)
@ -1815,7 +1815,7 @@ void CBaseAnimating::CalculateIKLocks( float currentTime )
else
{
pTarget->SetPos( trace.endpos );
pTarget->SetAngles( GetRenderAngles() );
pTarget->SetAngles( GetAbsAngles() );
pTarget->SetOnWorld( true );
}
}
@ -2031,7 +2031,7 @@ void CBaseAnimating::SetupBones( matrix3x4_t *pBoneToWorld, int boneMask )
// FIXME: pass this into Studio_BuildMatrices to skip transforms
CBoneBitList boneComputed;
m_iIKCounter++;
m_pIk->Init( pStudioHdr, GetRenderAngles(), adjOrigin, gpGlobals->curtime, m_iIKCounter, boneMask );
m_pIk->Init( pStudioHdr, GetAbsAngles(), adjOrigin, gpGlobals->curtime, m_iIKCounter, boneMask );
GetSkeleton( pStudioHdr, pos, q, boneMask );
UpdateIKLocks( gpGlobals->curtime );
@ -2055,7 +2055,7 @@ void CBaseAnimating::SetupBones( matrix3x4_t *pBoneToWorld, int boneMask )
{
BuildMatricesWithBoneMerge(
pStudioHdr,
GetRenderAngles(),
GetAbsAngles(),
adjOrigin,
pos,
q,
@ -2074,7 +2074,7 @@ void CBaseAnimating::SetupBones( matrix3x4_t *pBoneToWorld, int boneMask )
Studio_BuildMatrices(
pStudioHdr,
GetRenderAngles(),
GetAbsAngles(),
adjOrigin,
pos,
q,
@ -3036,7 +3036,7 @@ void CBaseAnimating::GetSkeleton( CStudioHdr *pStudioHdr, Vector pos[], Quaterni
if ( m_pIk )
{
CIKContext auto_ik;
auto_ik.Init( pStudioHdr, GetRenderAngles(), GetAbsOrigin(), gpGlobals->curtime, m_iIKCounter, boneMask );
auto_ik.Init( pStudioHdr, GetAbsAngles(), GetAbsOrigin(), gpGlobals->curtime, m_iIKCounter, boneMask );
boneSetup.CalcAutoplaySequences( pos, q, gpGlobals->curtime, &auto_ik );
}
else

View file

@ -427,11 +427,6 @@ public:
const Vector& GetAbsOrigin( void ) const;
const QAngle& GetAbsAngles( void ) const;
virtual const QAngle& GetRenderAngles( void )
{
return GetAbsAngles();
}
SolidType_t GetSolid() const;
int GetSolidFlags( void ) const;

View file

@ -302,7 +302,6 @@ IMPLEMENT_SERVERCLASS_ST( CCSPlayer, DT_CSPlayer )
SendPropInt( SENDINFO( m_iClass ), Q_log2( CS_NUM_CLASSES )+1, SPROP_UNSIGNED ),
SendPropInt( SENDINFO( m_ArmorValue ), 8 ),
SendPropQAngles(SENDINFO(m_angEyeAngles)),
SendPropQAngles(SENDINFO(m_angRenderAngles)),
SendPropBool( SENDINFO( m_bHasDefuser ) ),
SendPropBool( SENDINFO( m_bNightVisionOn ) ), //send as int so we can use a RecvProxy on the client
SendPropBool( SENDINFO( m_bHasNightVision ) ),
@ -1585,7 +1584,7 @@ void CCSPlayer::PostThink()
m_PlayerAnimState->Update( m_angEyeAngles[YAW], m_angEyeAngles[PITCH] );
// Use the m_angRotation instead.
m_angRenderAngles = m_PlayerAnimState->GetRenderAngles();
SetAbsAngles( m_PlayerAnimState->GetRenderAngles() );
// check if we need to apply a deafness DSP effect.
if ((m_applyDeafnessTime != 0.0f) && (m_applyDeafnessTime <= gpGlobals->curtime))

View file

@ -245,8 +245,6 @@ public:
static CCSPlayer *CreatePlayer( const char *className, edict_t *ed );
static CCSPlayer* Instance( int iEnt );
virtual const QAngle& GetRenderAngles( void );
virtual void Precache();
virtual void Spawn();
virtual void InitialSpawn( void );
@ -816,7 +814,6 @@ public:
// Copyed from EyeAngles() so we can send it to the client.
CNetworkQAngle( m_angEyeAngles );
CNetworkQAngle( m_angRenderAngles );
bool m_bVCollisionInitted;

View file

@ -17,9 +17,6 @@
#include "util.h"
#include "utllinkedlist.h"
#include "BaseAnimatingOverlay.h"
#ifdef CSTRIKE_DLL
#include "cs_player.h"
#endif
#include "tier0/vprof.h"
// memdbgon must be the last include file in a .cpp file!!!
@ -77,9 +74,6 @@ struct LagRecord
float m_masterCycle;
float m_poseParameters[MAXSTUDIOPOSEPARAM];
float m_encodedControllers[MAXSTUDIOBONECTRLS];
#ifdef CSTRIKE_DLL
QAngle m_angRenderAngles;
#endif
};
//
@ -226,15 +220,6 @@ void CLagCompensationManager::TrackEntities()
}
}
#ifdef CSTRIKE_DLL
auto csPlayer = dynamic_cast<CCSPlayer*>(pEntity);
if (csPlayer)
{
record.m_angRenderAngles = csPlayer->GetRenderAngles();
}
#endif
track->Push( record );
}
}
@ -570,16 +555,6 @@ inline void CLagCompensationManager::BacktrackEntity( CBaseEntity* pEntity, int
flags |= LC_ANIM_OVERS_CHANGED;
}
#ifdef CSTRIKE_DLL
auto csPlayer = dynamic_cast<CCSPlayer*>(pEntity);
if (csPlayer && foundAnim)
{
restore->m_angRenderAngles = csPlayer->GetRenderAngles();
csPlayer->m_angRenderAngles = recordAnim->m_angRenderAngles;
}
#endif
Finish();
}
@ -678,13 +653,6 @@ void CLagCompensationManager::FinishLagCompensation( CBasePlayer* player )
}
}
auto csPlayer = dynamic_cast<CCSPlayer*>(pEntity);
if (csPlayer)
{
csPlayer->m_angRenderAngles = restore->m_angRenderAngles;
}
pEntity->SetSimulationTime( restore->m_flSimulationTime );
pEntity->SetAnimTime( restore->m_flAnimTime );
}

View file

@ -44,22 +44,6 @@
ConVar weapon_accuracy_nospread( "weapon_accuracy_nospread", "0", FCVAR_REPLICATED );
#define CS_MASK_SHOOT (MASK_SOLID|CONTENTS_DEBRIS)
const QAngle& CCSPlayer::GetRenderAngles()
{
#ifdef CLIENT_DLL
if ( IsRagdoll() )
{
return vec3_angle;
}
else
{
return m_angRenderAngles;
}
#else
return m_angRenderAngles;
#endif
}
void DispatchEffect( const char *pName, const CEffectData &data );
#ifdef _DEBUG
@ -557,7 +541,7 @@ void CCSPlayer::FireBullet(
QAngle angles[MAXSTUDIOBONES];
int indexes[MAXSTUDIOBONES];
auto angle = lagPlayer->GetRenderAngles();
auto angle = lagPlayer->GetAbsAngles();
auto position = lagPlayer->GetAbsOrigin();
event->SetFloat( "position_x", position.x );

View file

@ -336,7 +336,7 @@ void FX_FireBullets(
C_CSPlayer::HitboxRecord record;
record.m_vecAbsOrigin = lagPlayer->GetAbsOrigin();
record.m_angAbsRotation = lagPlayer->GetRenderAngles();
record.m_angAbsRotation = lagPlayer->GetAbsAngles();
record.m_nAttackerTickBase = pPlayer->m_nTickBase;
record.m_flSimulationTime = lagPlayer->m_flInterpolatedSimulationTime;