Skip to content

Commit

Permalink
Add notes about new holdaim
Browse files Browse the repository at this point in the history
  • Loading branch information
wopox1337 committed Jun 27, 2021
1 parent aaffe43 commit 38cb2f7
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions rehlds/engine/sv_user.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,63 @@ void SV_RunCmd(usercmd_t *ucmd, int random_seed)

if (!host_client->fakeclient)
SV_RestoreMove(host_client);

// If we have to restore the view angle then do so right now

// TODO: Implement: in `player.h` & `player.cpp`
/*
QAngle m_qangLockViewangles;
int m_iLockViewanglesTickNumber;
int GetLockViewanglesTickNumber() const { return m_iLockViewanglesTickNumber; }
QAngle GetLockViewanglesData() const { return m_qangLockViewangles; }
////////////
void CCSPlayer::NoteWeaponFired()
{
Assert( m_pCurrentCommand );
if( m_pCurrentCommand )
{
m_iLastWeaponFireUsercmd = m_pCurrentCommand->command_number;
}
// Remember the tickcount when the weapon was fired and lock viewangles here!
if ( m_iLockViewanglesTickNumber != gpGlobals->tickcount )
{
m_iLockViewanglesTickNumber = gpGlobals->tickcount;
m_qangLockViewangles = pl.v_angle;
}
}
*/

/**
Implement in CCSPlayer::FireBullet:
// Let the player remember the usercmd he fired a weapon on. Assists in making decisions about lag compensation.
if ( pPlayer )
pPlayer->NoteWeaponFired();
if ( bBulletHitPlayer && !bShotHitTeammate )
{ // Guarantee that the bullet that hit an enemy trumps the player viewangles
// that are locked in for the duration of the server simulation ticks
m_iLockViewanglesTickNumber = gpGlobals->tickcount;
m_qangLockViewangles = pl.v_angle;
}
*/

/*
Implement in SV_RunCmd():
// player->IsBot() == sv_player->fakeclient
// tickcount == m_System->GetTick()
if ( !player->IsBot() &&
( gpGlobals->tickcount - player->GetLockViewanglesTickNumber() < sv_maxusrcmdprocessticks_holdaim.value ) )
{
player->pl.v_angle = player->GetLockViewanglesData();
}
*/
}

int SV_ValidateClientCommand(char *pszCommand)
Expand Down

0 comments on commit 38cb2f7

Please sign in to comment.