C++ Secrethack resolve air ported to supremacy R2P

Новичок
Статус
Оффлайн
Регистрация
19 Июл 2021
Сообщения
30
Реакции[?]
0
Поинты[?]
0
C++:
void Resolver::resolve_air_shack(AimPlayer* data, LagRecord* record, Player* player) {
    float vel_yaw = math::rad_to_deg(std::atan2(record->m_anim_velocity.y, record->m_anim_velocity.x));
        LagRecord* previous = data->m_records.size() >= 2 ? previous = data->m_records[1].get() : nullptr;
        LagRecord* move = &data->m_walk_record;


    bool has_body_updated = fabsf(math::AngleDiff(data->m_old_body, record->m_body)) >= 35.f
        || previous
        && fabsf(math::AngleDiff(record->m_body, previous->m_body)) >= 35.f;

    float move_diff = fabsf(move->m_body - record->m_body);
    float back_diff = fabsf(get_away_angle(record) - record->m_body);
    float vel_yaw_diff = fabsf(vel_yaw + 180.f - record->m_body);

    float low_neg_delta = 17.5f;
    float neg_delta = 35.f;

    // NOTE: we do not need move data to do this
    if (previous) {
        // or anim lby changed   
        // NOTE: here i remove proxy stuff
        // cus im not sure if proxy is more or less accurate
        // as its not on animation time but just on server
        // which means it will trigger fake updates on break lc etc.. (lol...)
        bool timer_update = (data->m_body_proxy_updated && data->m_body_update <= record->m_anim_time);
        bool body_update = data->m_has_body_updated && fabsf(math::AngleDiff(record->m_body, previous->m_body)) >= 35.f; // it was 17.5f
        if (data->m_missed_shots < 2) {
            // update this value
            data->m_has_body_updated = body_update || timer_update;

            if (body_update || timer_update) {
                // note: this is probably inaccurate, should be simtime and not animtime   
                // ^ reading abt uc makes me think it is actually right but im not sure
                // cus in 2018 update is handled diff, data is sent on lag == 0 and not on m_bSendPacket = true;
                // aka 1 tick after sending packet ( would explain why old sim time + interval )
                data->m_body_update = record->m_anim_time + 1.1f;

                record->m_eye_angles.y = record->m_body;
                record->m_mode = Modes::BODY_FLICK;
                return;
            }
        }
    }

    // lby breaker stuff above everything so we detect lby updates in airs too
    bool use_lby = fabsf(record->m_body - low_neg_delta) >= (back_diff || vel_yaw_diff); // detect retards constantly swapping their angles

    if (use_lby && fabsf(previous->m_body - record->m_body) <= neg_delta)
        record->m_eye_angles.y = record->m_body + neg_delta;

    if (move_diff <= low_neg_delta && !has_body_updated && data->m_missed_shots < 1)
        record->m_eye_angles.y = move->m_body;

    if (back_diff <= vel_yaw_diff && fabsf(vel_yaw_diff - low_neg_delta) <= (neg_delta + 10.f))
        record->m_eye_angles.y = vel_yaw + 180.f;

    else if (fabsf(back_diff - neg_delta) <= (neg_delta - 7.5f))
        record->m_eye_angles.y = get_away_angle(record);

    else if (back_diff >= neg_delta && vel_yaw_diff >= neg_delta)
        record->m_eye_angles.y = record->m_body;
}
 
Начинающий
Статус
Оффлайн
Регистрация
5 Фев 2021
Сообщения
8
Реакции[?]
1
Поинты[?]
1K
C++:
void Resolver::resolve_air_shack(AimPlayer* data, LagRecord* record, Player* player) {
    float vel_yaw = math::rad_to_deg(std::atan2(record->m_anim_velocity.y, record->m_anim_velocity.x));
        LagRecord* previous = data->m_records.size() >= 2 ? previous = data->m_records[1].get() : nullptr;
        LagRecord* move = &data->m_walk_record;


    bool has_body_updated = fabsf(math::AngleDiff(data->m_old_body, record->m_body)) >= 35.f
        || previous
        && fabsf(math::AngleDiff(record->m_body, previous->m_body)) >= 35.f;

    float move_diff = fabsf(move->m_body - record->m_body);
    float back_diff = fabsf(get_away_angle(record) - record->m_body);
    float vel_yaw_diff = fabsf(vel_yaw + 180.f - record->m_body);

    float low_neg_delta = 17.5f;
    float neg_delta = 35.f;

    // NOTE: we do not need move data to do this
    if (previous) {
        // or anim lby changed  
        // NOTE: here i remove proxy stuff
        // cus im not sure if proxy is more or less accurate
        // as its not on animation time but just on server
        // which means it will trigger fake updates on break lc etc.. (lol...)
        bool timer_update = (data->m_body_proxy_updated && data->m_body_update <= record->m_anim_time);
        bool body_update = data->m_has_body_updated && fabsf(math::AngleDiff(record->m_body, previous->m_body)) >= 35.f; // it was 17.5f
        if (data->m_missed_shots < 2) {
            // update this value
            data->m_has_body_updated = body_update || timer_update;

            if (body_update || timer_update) {
                // note: this is probably inaccurate, should be simtime and not animtime  
                // ^ reading abt uc makes me think it is actually right but im not sure
                // cus in 2018 update is handled diff, data is sent on lag == 0 and not on m_bSendPacket = true;
                // aka 1 tick after sending packet ( would explain why old sim time + interval )
                data->m_body_update = record->m_anim_time + 1.1f;

                record->m_eye_angles.y = record->m_body;
                record->m_mode = Modes::BODY_FLICK;
                return;
            }
        }
    }

    // lby breaker stuff above everything so we detect lby updates in airs too
    bool use_lby = fabsf(record->m_body - low_neg_delta) >= (back_diff || vel_yaw_diff); // detect retards constantly swapping their angles

    if (use_lby && fabsf(previous->m_body - record->m_body) <= neg_delta)
        record->m_eye_angles.y = record->m_body + neg_delta;

    if (move_diff <= low_neg_delta && !has_body_updated && data->m_missed_shots < 1)
        record->m_eye_angles.y = move->m_body;

    if (back_diff <= vel_yaw_diff && fabsf(vel_yaw_diff - low_neg_delta) <= (neg_delta + 10.f))
        record->m_eye_angles.y = vel_yaw + 180.f;

    else if (fabsf(back_diff - neg_delta) <= (neg_delta - 7.5f))
        record->m_eye_angles.y = get_away_angle(record);

    else if (back_diff >= neg_delta && vel_yaw_diff >= neg_delta)
        record->m_eye_angles.y = record->m_body;
}
stop reposting from shit channel....
 
Начинающий
Статус
Оффлайн
Регистрация
18 Июн 2020
Сообщения
9
Реакции[?]
0
Поинты[?]
0
// update this value
data->m_has_body_updated = body_update || timer_update;

if (body_update || timer_update) {
// note: this is probably inaccurate, should be simtime and not animtime
// ^ reading abt uc makes me think it is actually right but im not sure
// cus in 2018 update is handled diff, data is sent on lag == 0 and not on m_bSendPacket = true;
// aka 1 tick after sending packet ( would explain why old sim time + interval )
data->m_body_update = record->m_anim_time + 1.1f;

record->m_eye_angles.y = record->m_body;
record->m_mode = Modes::BODY_FLICK;
return;
}



start by reading this lol
 
Начинающий
Статус
Оффлайн
Регистрация
15 Июл 2019
Сообщения
57
Реакции[?]
6
Поинты[?]
1K
// update this value
data->m_has_body_updated = body_update || timer_update;

if (body_update || timer_update) {
// note: this is probably inaccurate, should be simtime and not animtime
// ^ reading abt uc makes me think it is actually right but im not sure
// cus in 2018 update is handled diff, data is sent on lag == 0 and not on m_bSendPacket = true;
// aka 1 tick after sending packet ( would explain why old sim time + interval )
data->m_body_update = record->m_anim_time + 1.1f;

record->m_eye_angles.y = record->m_body;
record->m_mode = Modes::BODY_FLICK;
return;
}



start by reading this lol
:anguished::sob::tearsofjoy:
 
Сверху Снизу