Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 0 additions & 18 deletions src/game/server/hl2mp/hl2mp_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ CHL2MP_Player::CHL2MP_Player() : m_PlayerAnimState( this )
{
m_angEyeAngles.Init();

m_iLastWeaponFireUsercmd = 0;

m_flNextModelChangeTime = 0.0f;
m_flNextTeamChangeTime = 0.0f;

Expand Down Expand Up @@ -651,8 +649,6 @@ void CHL2MP_Player::FireBullets ( const FireBulletsInfo_t &info )
modinfo.m_iPlayerDamage = modinfo.m_flDamage = pWeapon->GetHL2MPWpnData().m_iPlayerDamage;
}

NoteWeaponFired();

BaseClass::FireBullets( modinfo );

// Move other players back to history positions based on local player's lag
Expand All @@ -669,24 +665,10 @@ void CHL2MP_Player::OnMyWeaponFired( CBaseCombatWeapon* weapon )
TheNextBots().OnWeaponFired( this, weapon );
}

void CHL2MP_Player::NoteWeaponFired( void )
{
Assert( m_pCurrentCommand );
if( m_pCurrentCommand )
{
m_iLastWeaponFireUsercmd = m_pCurrentCommand->command_number;
}
}

extern ConVar sv_maxunlag;

bool CHL2MP_Player::WantsLagCompensationOnEntity( const CBasePlayer *pPlayer, const CUserCmd *pCmd, const CBitVec<MAX_EDICTS> *pEntityTransmitBits ) const
{
// No need to lag compensate at all if we're not attacking in this command and
// we haven't attacked recently.
if ( !( pCmd->buttons & IN_ATTACK ) && (pCmd->command_number - m_iLastWeaponFireUsercmd > 5) )
return false;

// If this entity hasn't been transmitted to us and acked, then don't bother lag compensating it.
if ( pEntityTransmitBits && !pEntityTransmitBits->Get( pPlayer->entindex() ) )
return false;
Expand Down
3 changes: 0 additions & 3 deletions src/game/server/hl2mp/hl2mp_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ class CHL2MP_Player : public CHL2_Player
void GiveAllItems( void );
void GiveDefaultItems( void );

void NoteWeaponFired( void );

void ResetAnimation( void );
void SetPlayerModel( void );
void SetPlayerTeamModel( void );
Expand Down Expand Up @@ -148,7 +146,6 @@ class CHL2MP_Player : public CHL2_Player
CNetworkQAngle( m_angEyeAngles );
CPlayerAnimState m_PlayerAnimState;

int m_iLastWeaponFireUsercmd;
int m_iModelType;
CNetworkVar( int, m_iSpawnInterpCounter );
CNetworkVar( int, m_iPlayerSoundType );
Expand Down