a bit different approach

This commit is contained in:
2025-01-26 20:05:16 +03:00
parent 87b184b48a
commit f45bbdf92e
7 changed files with 20 additions and 11 deletions

View File

@@ -433,6 +433,7 @@ BEGIN_RECV_TABLE_NOBASE(C_BaseEntity, DT_BaseEntity)
RecvPropDataTable( "AnimTimeMustBeFirst", 0, 0, &REFERENCE_RECV_TABLE(DT_AnimTimeMustBeFirst) ),
RecvPropInt( RECVINFO(m_flSimulationTime), 0, RecvProxy_SimulationTime ),
RecvPropInt( RECVINFO( m_ubInterpolationFrame ) ),
RecvPropBool( RECVINFO( m_bForceNoInterpolate ) ),
RecvPropVector( RECVINFO_NAME( m_vecNetworkOrigin, m_vecOrigin ) ),
#if PREDICTION_ERROR_CHECK_LEVEL > 1

View File

@@ -1287,8 +1287,6 @@ public:
// Entity flags that are only for the client (ENTCLIENTFLAG_ defines).
unsigned short m_EntClientFlags;
bool m_bForceNoInterpolate;
CNetworkColor32( m_clrRender );
private:
@@ -1309,6 +1307,8 @@ public:
byte m_ubInterpolationFrame;
byte m_ubOldInterpolationFrame;
bool m_bForceNoInterpolate;
private:
// Effects to apply
unsigned char m_nRenderMode;

View File

@@ -99,7 +99,7 @@ class CBoundedCvar_Interp : public ConVar_ServerBounded
public:
CBoundedCvar_Interp() :
ConVar_ServerBounded( "cl_interp",
"0.1",
"0.025",
FCVAR_USERINFO | FCVAR_NOT_CONNECTED,
"Sets the interpolation amount (bounded on low side by server interp ratio settings).", true, 0.0f, true, 0.5f )
{

View File

@@ -269,6 +269,7 @@ IMPLEMENT_SERVERCLASS_ST_NOBASE( CBaseEntity, DT_BaseEntity )
#endif
SendPropInt (SENDINFO( m_ubInterpolationFrame ), NOINTERP_PARITY_MAX_BITS, SPROP_UNSIGNED ),
SendPropBool (SENDINFO( m_bForceNoInterpolate )),
SendPropModelIndex(SENDINFO(m_nModelIndex)),
SendPropDataTable( SENDINFO_DT( m_Collision ), &REFERENCE_SEND_TABLE(DT_CollisionProperty) ),
SendPropInt (SENDINFO(m_nRenderFX), 8, SPROP_UNSIGNED ),

View File

@@ -814,6 +814,9 @@ public:
CNetworkVar( int, m_ubInterpolationFrame );
CNetworkVar( bool, m_bForceNoInterpolate );
int m_nLastThinkTick;
#if !defined( NO_ENTITY_PREDICTION )

View File

@@ -594,7 +594,7 @@ CBasePlayer::CBasePlayer( )
m_hZoomOwner = NULL;
m_nUpdateRate = 20; // cl_updaterate defualt
m_fLerpTime = 0.1f; // cl_interp default
m_fLerpTime = 0.025f; // cl_interp default
m_bPredictWeapons = true;
m_bLagCompensation = false;
m_flLaggedMovementValue = 1.0f;

View File

@@ -550,6 +550,7 @@ void CGrabController::AttachEntity( CBasePlayer *pPlayer, CBaseEntity *pEntity,
pList[i]->SetDamping( NULL, &damping );
}
// Give extra mass to the phys object we're actually picking up
pPhys->SetMass( REDUCED_CARRY_MASS );
pPhys->EnableDrag( false );
@@ -576,6 +577,8 @@ void CGrabController::AttachEntity( CBasePlayer *pPlayer, CBaseEntity *pEntity,
{
m_bHasPreferredCarryAngles = false;
}
pEntity->m_bForceNoInterpolate = true;
#else
//pEntity->SetPredictable(false);
m_bHasPreferredCarryAngles = false;
@@ -633,9 +636,10 @@ void CGrabController::DetachEntity( bool bClearVelocity )
}
}
#ifdef CLIENT_DLL
#ifndef CLIENT_DLL
//pEntity->SetPredictable(true);
//pEntity->m_bForceNoInterpolate = false;
if(pEntity)
pEntity->m_bForceNoInterpolate = false;
#endif
m_attachedEntity = NULL;
@@ -2534,11 +2538,11 @@ void CWeaponPhysCannon::ItemPreFrame()
//if ( localplayer && !localplayer->IsObserver() )
// ManagePredictedObject();
if(m_hAttachedObject)
m_hAttachedObject.Get()->m_bForceNoInterpolate = true;
else
if(m_hOldAttachedObject)
m_hOldAttachedObject.Get()->m_bForceNoInterpolate = false;
//if(m_hAttachedObject)
// m_hAttachedObject.Get()->m_bForceNoInterpolate = true;
//else
// if(m_hOldAttachedObject)
// m_hOldAttachedObject.Get()->m_bForceNoInterpolate = false;
#endif
// Update the object if the weapon is switched on.