-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
C++:
if ( record->m_origin != previous->m_origin || record->m_velocity != previous->m_velocity )
{
if ( record->m_shot != previous->m_shot || valve::to_ticks( record->m_shot_time ) != valve::to_ticks( previous->m_shot_time ) )
{
auto previous_tick_base = valve::to_ticks( record->m_pre_sim_time ) + 1;
auto current_tick_base = valve::to_ticks( record->m_sim_time );
if ( current_tick_base != previous_tick_base )
{
auto last_update_ticks = std::clamp( ( valve::g_client_state->m_server_tick - record->m_last_server_tick ), 0, 15 );
auto last_update_ticks_simulation = current_tick_base - current_tick_base;
if ( last_update_ticks_simulation <= 0 ) {
record->m_invalid = true;
record->m_sim_ticks = last_update_ticks - 1;
record->m_first_cmd_time_pushed_after_shift = valve::to_time( current_tick_base - last_update_ticks_simulation - 1 );
}
else if ( std::abs( last_update_ticks_simulation - last_update_ticks ) > 0 && !previous->m_invalid ) {
previous->m_invalid = true;
record->m_sim_ticks = last_update_ticks - 1;
record->m_first_cmd_time_pushed_after_shift = valve::to_time( current_tick_base - last_update_ticks_simulation - 1 );
}
else {
record->m_sim_ticks = last_update_ticks - 1;
record->m_first_cmd_time_pushed_after_shift = valve::to_time( current_tick_base - last_update_ticks_simulation - 1 );
}
if ( record->m_sim_time <= record->m_newest_sim_time )
record->m_invalid = true;
else {
if ( current_tick_base == previous_tick_base )
record->m_invalid = true;
}
last_update_ticks_simulation = 0;
}
}
}