Вопрос Не работает автострейф

Пользователь
Статус
Оффлайн
Регистрация
8 Янв 2020
Сообщения
187
Реакции[?]
138
Поинты[?]
20K
Взял дирекшинал автострейф с вантапа, а он не работает. Как будто вообще без автострейфа бхоплю. Кто-нибудь знает как это исправить?



C++:
float govno(float slol)
{
    bool left = g_cl.m_cmd->m_buttons & IN_MOVELEFT; // v12
    bool right = g_cl.m_cmd->m_buttons & IN_MOVERIGHT; // v4
    bool forward = g_cl.m_cmd->m_buttons & IN_FORWARD; // v6
    bool backward = g_cl.m_cmd->m_buttons & IN_BACK;

    float viewangles_yaw = g_cl.m_strafe_angles.y;
    float final_strafe = 0.0; // v5

    if (forward || !backward)
    {
        if (left)
        {
            if (forward)
                final_strafe = 45.0;
            else
                final_strafe = 90.0;
        }

        if (right)
        {
            if (forward)
                final_strafe = -45.0;
            else
                final_strafe = -90.0;
        }
    }
    else
    {
        if (left)
        {
            final_strafe = 135.0;

            if (!right)
                goto LABEL_16;
        }
        else if (!right)
        {
            final_strafe = -180.0;
            goto LABEL_16;
        }

        final_strafe = -135.0;
    }

LABEL_16:
    auto v7 = 0.0;

    if (final_strafe != 0.0)
    {
        float j = math::normalize_float(final_strafe);
        float v10 = fminf(slol, abs(j));

        if (j <= 0.0)
            v7 = -v10;
        else
            v7 = v10;
    }

    unk_flt = v7;

    return math::normalize_float(v7 + viewangles_yaw);
}

void Directional()
{
    // [COLLAPSED LOCAL DECLARATIONS. PRESS KEYPAD CTRL-"+" TO EXPAND]
    if (g_cl.m_cmd->m_buttons & IN_JUMP && g_cl.m_local->m_vecVelocity().length_2d() >= 30.0)
    {
        float v14 = 0.0;
        float v39 = math::rad_to_deg(std::asinf((float)(30.0 / g_cl.m_local->m_vecVelocity().length_2d()))) * 0.5;

        if (unk2)
            v14 = 180.0;
        else
            v14 = abs(v39) * (float)((float)((float)/*g_menu.main.movement.strafe_val.get()*/ 50.0 / 100.0) + 1.0);

        float v42 = govno(v14);

        float absYaw = math::normalize_float(math::rad_to_deg(atan2(g_cl.m_local->m_vecVelocity().y, g_cl.m_local->m_vecVelocity().x)));
        float delta = math::normalize_float(v42 - absYaw);

        bool positive = false;

        if (abs(delta) <= 1.0)
            positive = g_cl.m_cmd->m_command_number & 1;
        else
            positive = delta > 0.0;

        float yawDirection = 0.0;

        if (positive)
        {
            v39 = -v39;
            yawDirection = 450.0;
        }
        else
            yawDirection = -450.0;

        g_cl.m_strafe_angles.y = v42;

        g_cl.m_cmd->m_forward_move = 0.0;
        g_cl.m_cmd->m_side_move = yawDirection;

        float cos_rot = cos(v39);
        float sin_rot = sin(v39);

        float forwardmove = (cos_rot * g_cl.m_cmd->m_forward_move) - (sin_rot * g_cl.m_cmd->m_side_move);
        float sidemove = (sin_rot * g_cl.m_cmd->m_forward_move) + (cos_rot * g_cl.m_cmd->m_side_move);

        g_cl.m_cmd->m_forward_move = forwardmove;
        g_cl.m_cmd->m_side_move = sidemove;

        unk2 = false;
    }
    else
    {
        unk_flt = 0.0;
        unk2 = true;
    }
}
 
Сверху Снизу