Исходник Rebuilt source_sdk tickbase

Участник
Статус
Оффлайн
Регистрация
6 Апр 2021
Сообщения
343
Реакции[?]
216
Поинты[?]
122K
C++:
namespace src_sdk {
    void c_tickbase::rebuild_tickbase_and_correct( ) {
        /* pre-define interfeaces */
        auto g_ClientState = g_csgo.m_cl;
        auto g_Prediction = g_csgo.m_prediction;
        auto g_Globals = g_csgo.m_globals;

        /* sanity */
        auto g_LocalPlayer = g_cl.m_local;
        if ( g_LocalPlayer )
            return;

        /* first we have to get the vars */
        int delta_tick = g_csgo.m_cl->m_delta_tick;
        bool valid = delta_tick > 0; /* the tick is only valid if delta > 0 */

        /* gabenworkspace */
        int last_command_acked = g_ClientState->m_last_command_ack;
        int last_outgoing_command = g_ClientState->m_last_outgoing_command;
        int choked_commands = g_ClientState->m_choked_commands;

        /* call IPrediction::Update */
        g_Prediction->Update( delta_tick, valid,
            last_command_acked, last_outgoing_command + choked_commands );

        m_flOldCurtime = g_Globals->m_curtime;
        m_nOldTickbase = g_LocalPlayer->m_nTickBase( );

        if ( g_LocalPlayer ) {
            /* apply current shift */
            g_tickshift.apply_current_shift( );

            /* i dont really understand why but whatever */
            g_Globals->m_curtime = game::TICKS_TO_TIME( g_LocalPlayer->m_nTickBase( ) );
        }
    }
}
 
Сверху Снизу