Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void __stdcall Hooked_CL_Move ( float accumulated_extra_samples, bool bFinalTick )
- {
- Host_ShouldRun = (Host_ShouldRunFn)( m_engine + 0xCFFE0 );
- CL_SendMove = (CL_SendMoveFn)( m_engine + 0x423D0 );
- Unknown = (UnknownFn)( m_engine + 0x2D00 );
- if ( *(DWORD*)( m_engine + 0x390AA8 ) > 2 )
- return;
- if ( !Host_ShouldRun () )
- return;
- int index = m_pEngine->GetLocalPlayer ();
- bool bSendPacket = true;
- CBaseEntity* player = m_pEntList->GetClientEntity ( index );
- int lastoutgoingcommand = *(int*)( m_engine + 0x39539C );
- int chokedcommands = *(int*)( m_engine + 0x3953A0 );
- if ( player )
- {
- CBaseWeapon* weapon = player->GetBaseWeapon ();
- if ( weapon )
- {
- float curtime = (player->GetTickBase () + 1) * m_pGlobal->interval_per_tick;
- float nextattack = weapon->GetNextAttack ();
- bool bulletTime = true;
- if ( nextattack > curtime )
- bulletTime = false;
- CUserCmd* cmd = m_pInput->GetUserCmd ( lastoutgoingcommand + chokedcommands + 1 );
- if ( cmd )
- {
- if ( (cmd->buttons & IN_ATTACK) && bulletTime )
- {
- bSendPacket = false;
- }
- else
- {
- bSendPacket = true;
- }
- }
- }
- }
- IDemoPlayer* demoplayer = (IDemoPlayer*)( m_engine + 0x375F9C );
- if ( demoplayer->IsPlayingBack () )
- {
- if ( *(bool*)( m_engine + 0x3953B0 ) )
- {
- bSendPacket = false;
- }
- else
- {
- return;
- }
- }
- CNetChan* m_NetChannel = (CNetChan*)( m_engine + 0x390990 );
- ConVar* host_limitlocal = (ConVar*)( m_engine + 0x4D2A48 );
- double net_time = *(double*)( m_engine + 0x4F5660 );
- double m_flNextCmdTime = *(double*)( m_engine + 0x390AB0 );
- if ( (!m_NetChannel->IsLoopback () || host_limitlocal->GetInt ()) &&
- ( ( net_time < m_flNextCmdTime ) || !m_NetChannel->CanPacket () || !bFinalTick ) )
- {
- bSendPacket = false;
- }
- if ( *(DWORD*)( m_engine + 0x390AA8 ) == 6 )
- {
- int nextcommandnr = lastoutgoingcommand + chokedcommands + 1;
- m_pClient->CreateMove ( nextcommandnr, m_pGlobal->interval_per_tick - accumulated_extra_samples, true );
- if ( bSendPacket )
- {
- CL_SendMove ();
- }
- else
- {
- m_NetChannel->SetChoked ();
- *(int*)( m_engine + 0x3953A0 ) += 1;
- return;
- }
- }
- if ( !bSendPacket )
- return;
- if ( *(DWORD*)( m_engine + 0x390AA8 ) == 6 )
- {
- DWORD v14 = Unknown ( *(DWORD*)( m_engine + 0x390B0C ) );
- (*(void (__stdcall **)( int, DWORD ))(*(DWORD*)0x20390990 + 144))(v14, 0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement