-
Автор темы
- #1
я забыл в том посте скинуть ну да похуй
имеет крутую анти пасту и крутой 3 айкью код 0____о
имеет крутую анти пасту и крутой 3 айкью код 0____о
C++:
void c_resolver::start( c_cs_player* player, c_lag_record* record, c_lag_record* previous_record ) {
if ( globals->m_missed_shots[ player->get_index( ) ].at( MISSED_SHOT_DUE_TO_UNRESOLVED ) >= 4 ) {
// setup resolve method and side to unresolved.
record->m_resolve_mode = RESOLVE_METHOD_UNRESOLVED;
record->m_resolve_side = RESOLVE_SIDE_UNRESOLVED;
}
// get lastest delta.
auto last_delta = 0.f;
if ( player->get_flags( ) & FL_ONGROUND ) {
// if standing or not can solve anim.
if ( player->get_velocity( ).length2d( ) <= 0.1 || !record->can_solve_anim ) {
// run auto freestand.
auto left_data_dmg = c_penetrate::get( ).get_dmg( globals->m_eye_pos, globals->m_local( ), 0 );
auto center_data_dmg = c_penetrate::get( ).get_dmg( globals->m_eye_pos, globals->m_local( ), 1 );
auto right_data_dmg = c_penetrate::get( ).get_dmg( globals->m_eye_pos, globals->m_local( ), 2 );
// main correction logic.
// resolving left side
if ( left_data_dmg > right_data_dmg || center_data_dmg > left_data_dmg ) {
// setup resolving method and side to ANTI_FREESTAND, LEFT.
record->m_resolve_mode = RESOLVE_METHOD_ANTI_FREESTAND;
record->m_resolve_side = RESOLVE_SIDE_LEFT;
// we set can solve anim to true.
record->can_solve_anim = true;
// setup last delta.
last_delta = center_data_dmg ? right_data_dmg : 1;
}
// resolving right side.
else if ( left_data_dmg < right_data_dmg || center_data_dmg > right_data_dmg ) {
// setup resolving method and side to ANTI_FREESTAND, RIGHT.
record->m_resolve_mode = RESOLVE_METHOD_ANTI_FREESTAND;
record->m_resolve_side = RESOLVE_SIDE_RIGHT;
// we set can solve anim to true.
record->can_solve_anim = true;
// setup last delta.
last_delta = center_data_dmg ? right_data_dmg : 2;
}
}
// go resolving moving or walk..
else {
// i using onetap method for this.
// and some improves idk...
if ( can_solve_anim
&& ( record->m_anim_layers[ 6 ].m_weight ) == ( previous_record->m_anim_layers[ 6 ].m_weight )
|| abs( last_delta ) < 50.f ) {
// get animation layers delta.
float delta_1 = abs( record->m_resolving_layers[ RESOLVING_SIDE_LEFT ][ 6 ].m_play_back_rate );
float delta_2 = abs( record->m_resolving_layers[ RESOLVING_SIDE_CENTER ][ 6 ].m_play_back_rate );
float delta_3 = abs( record->m_resolving_layers[ RESOLVING_SIDE_RIGHT ][ 6 ].m_play_back_rate );
if ( delta_1 > delta_2 || delta_3 <= delta_2 ) {
// setup resolving method and side to ANIM_LAYERS, LEFT.
record->m_resolve_mode = RESOLVE_METHOD_ANIM_LAYERS;
record->m_resolve_side = RESOLVE_SIDE_LEFT;
}
else if ( delta_1 < delta_2 && delta_2 >= delta_3 ) {
// setup resolving method and side to ANIM_LAYERS, RIGHT.
record->m_resolve_mode = RESOLVE_METHOD_ANIM_LAYERS;
record->m_resolve_side = RESOLVE_SIDE_RIGHT;
}
}
}
}
// bruteforce part looool.
if ( globals->m_missed_shots[ player->get_index( ) ].at( MISSED_SHOT_DUE_TO_UNRESOLVED ) > 0 && record->m_resolve_side > 0 ) {
switch ( record->m_resolve_side ) {
case 1: {
record->m_state->m_foot_yaw = math::normalize_yaw( player->get_eye_angles( ).y - 60.f );
record->m_resolve_mode = RESOLVING_METHOD_BRUTE;
break;
}
case 0: {
record->m_state->m_foot_yaw = math::normalize_yaw( player->get_eye_angles( ).y );
record->m_resolve_mode = RESOLVING_METHOD_BRUTE;
break;
}
case 2: {
record->m_state->m_foot_yaw = math::normalize_yaw( player->get_eye_angles( ).y + 60.f );
record->m_resolve_mode = RESOLVING_METHOD_BRUTE;
break;
}
}
}
// reset our value.
if ( record->m_bot || record->m_lag < 1 ) {
record->m_resolve_mode = RESOLVING_METHOD_NONE;
record->m_resolve_side = RESOLVE_SIDE_NONE;
return;
}
}