Исходник Is_valid_tick from nemesis

Забаненный
Статус
Оффлайн
Регистрация
10 Дек 2022
Сообщения
3
Реакции[?]
8
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
but code have some improves
C++:
bool lag_compensation::is_valid_tick( /*float time,*/ float sim_time, bool a2 ) {
    if ( /*time == 0 || */sim_time == 0 /*|| !a2*/ )
        return false;
 
    // get net channel info state
    i_net_channel_info* info = m_engine( )->get_net_channel_info( );
    if ( !info )
        return false;
 
    // get server tick
    // get_tick -> 208 index
    int server_tick = m_engine( )->get_tick( ) + TIME_TO_TICKS( info->get_avg_latency( FLOW_OUTGOING ) );
 
    // calc server_tick based on choked commands and determinate curr choked commands
    if ( globals::m_fake_ducking )
        server_tick = 14 - m_client_state( )->m_choked_commands;
 
    // get correct based on out latency + in latency + lerp time and clamp on sv_maxunlag
    float correct = 0;
 
    // add out latency
    correct += info->get_avg_latency( FLOW_OUTGOING );
 
    // add in latency
    correct += info->get_avg_latency( FLOW_INCOMING );
 
    // add interpolation amount
    correct += get_lerp_time( );
 
    // clamp this shit
    correct = clamp( correct, 0, sv_maxunlag->get_float( ) );
 
    // calc tickbase
    int shift = 0;
    if ( globals::m_fake_ducking || !globals::m_exploits_allowed || globals::m_double_tap_key.not_pressed( ) || globals::m_hide_shots.not_pressed( ) )
        shift = 0;
    else {
        if ( globals::m_exploits_allowed && globals::m_double_tap_key.has_pressed( ) || globals::m_hide_shots.has_pressed( ) && !globals::m_fake_ducking ) {
            // determinate shift amount
            shift = max( globals::m_shift_amount, globals::m_next_shift_amount );
         
            // ohh thanks reisss for this premium codeeee
            if ( globals::m_double_tap_key.has_pressed( ) || globals::m_hide_shots.has_pressed( ) && ( globals::m_ticks_allowed > 0 && globals::m_ticks_allowed < 15 ) )
                shift = 14;
        }
    }
 
    // def cur time
    float time = m_globals( )->m_cur_time;
     
    // get time based on shift amount
    time = globals::m_local->is_alive( ) ? TICKS_TO_TIME( shift ) : m_globals( )->m_cur_time;
 
    // get delta time
    float delta_time = fabsf( correct - ( time - sim_time ) );
 
    // if out of range
    if ( delta_time > 0.2 )
        return false;
 
    // just ignore dead time or not?
    return ( a2 ) || ( TICKS_TO_TIME( server_tick ) - sv_maxunlag->get_float( ) );
}
 
like amiri in my mind
Пользователь
Статус
Оффлайн
Регистрация
4 Дек 2022
Сообщения
308
Реакции[?]
54
Поинты[?]
1K
its real cool but dont forget about proper tickbase manipulation, and animfix +rep
 
ЧВК EB_LAN
Забаненный
Статус
Оффлайн
Регистрация
12 Янв 2019
Сообщения
838
Реакции[?]
298
Поинты[?]
17K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
but code have some improves
C++:
bool lag_compensation::is_valid_tick( /*float time,*/ float sim_time, bool a2 ) {
    if ( /*time == 0 || */sim_time == 0 /*|| !a2*/ )
        return false;

    // get net channel info state
    i_net_channel_info* info = m_engine( )->get_net_channel_info( );
    if ( !info )
        return false;

    // get server tick
    // get_tick -> 208 index
    int server_tick = m_engine( )->get_tick( ) + TIME_TO_TICKS( info->get_avg_latency( FLOW_OUTGOING ) );

    // calc server_tick based on choked commands and determinate curr choked commands
    if ( globals::m_fake_ducking )
        server_tick = 14 - m_client_state( )->m_choked_commands;

    // get correct based on out latency + in latency + lerp time and clamp on sv_maxunlag
    float correct = 0;

    // add out latency
    correct += info->get_avg_latency( FLOW_OUTGOING );

    // add in latency
    correct += info->get_avg_latency( FLOW_INCOMING );

    // add interpolation amount
    correct += get_lerp_time( );

    // clamp this shit
    correct = clamp( correct, 0, sv_maxunlag->get_float( ) );

    // calc tickbase
    int shift = 0;
    if ( globals::m_fake_ducking || !globals::m_exploits_allowed || globals::m_double_tap_key.not_pressed( ) || globals::m_hide_shots.not_pressed( ) )
        shift = 0;
    else {
        if ( globals::m_exploits_allowed && globals::m_double_tap_key.has_pressed( ) || globals::m_hide_shots.has_pressed( ) && !globals::m_fake_ducking ) {
            // determinate shift amount
            shift = max( globals::m_shift_amount, globals::m_next_shift_amount );
        
            // ohh thanks reisss for this premium codeeee
            if ( globals::m_double_tap_key.has_pressed( ) || globals::m_hide_shots.has_pressed( ) && ( globals::m_ticks_allowed > 0 && globals::m_ticks_allowed < 15 ) )
                shift = 14;
        }
    }

    // def cur time
    float time = m_globals( )->m_cur_time;
    
    // get time based on shift amount
    time = globals::m_local->is_alive( ) ? TICKS_TO_TIME( shift ) : m_globals( )->m_cur_time;

    // get delta time
    float delta_time = fabsf( correct - ( time - sim_time ) );

    // if out of range
    if ( delta_time > 0.2 )
        return false;

    // just ignore dead time or not?
    return ( a2 ) || ( TICKS_TO_TIME( server_tick ) - sv_maxunlag->get_float( ) );
}
Хуйня
 
Новичок
Статус
Оффлайн
Регистрация
26 Фев 2018
Сообщения
1
Реакции[?]
0
Поинты[?]
0
int shift = 0; if ( globals::m_fake_ducking || !globals::m_exploits_allowed || globals::m_double_tap_key.not_pressed( ) || globals::m_hide_shots.not_pressed( ) ) shift = 0; else { if ( globals::m_exploits_allowed && globals::m_double_tap_key.has_pressed( ) || globals::m_hide_shots.has_pressed( ) && !globals::m_fake_ducking ) { // determinate shift amount shift = max( globals::m_shift_amount, globals::m_next_shift_amount ); // ohh thanks reisss for this premium codeeee if ( globals::m_double_tap_key.has_pressed( ) || globals::m_hide_shots.has_pressed( ) && ( globals::m_ticks_allowed > 0 && globals::m_ticks_allowed < 15 ) ) shift = 14; } }
This part wont be correct based on what is later done in the code, u should subtract the shift amount from your unshifted tickbase, other than that it should probably work.
Something like this:
 // get time based on shift amount
    time = globals::m_local->is_alive( ) ? TICKS_TO_TIME( local_player_tickbase - shift ) : m_globals( )->m_cur_time;
Just pointing out whats wrong.
 
Сверху Снизу