Подпишитесь на наш Telegram-канал, чтобы всегда быть в курсе важных обновлений! Перейти

Исходник Trace to exit for lw

  • Автор темы Автор темы wseno
  • Дата начала Дата начала
Забаненный
Забаненный
Статус
Оффлайн
Регистрация
30 Июн 2021
Сообщения
17
Реакции
2
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Здhавствуйтеб все вот фикс trace to exit lw

Код:
Expand Collapse Copy
void TraceLine(Vector& absStart, const Vector& absEnd, unsigned int mask, player_t* ignore, CGameTrace* ptr)
{
    Ray_t ray;
    ray.Init(absStart, absEnd);
    CTraceFilter filter;
    filter.pSkip = ignore;

    m_trace()->TraceRay(ray, mask, &filter, ptr);
}

bool autowall::trace_to_exit(CGameTrace& enterTrace, CGameTrace& exitTrace, Vector startPosition, const Vector& direction)
{
    static ConVar* sv_clip_penetration_traces_to_players = m_cvar()->FindVar(crypt_str("sv_clip_penetration_traces_to_players"));

    Vector          new_end, out;
    float           dist = 0.0f;
    int                iterations = 23;
    int                first_contents = 0;
    int             contents;
    Ray_t r{};

    while (1)
    {
        iterations--;

        if (iterations <= 0 || dist > 90.f)
            break;

        dist += 4.0f;
        out = startPosition + (direction * dist);

        contents = m_trace()->GetPointContents(out, 0x4600400B, nullptr);

        if (first_contents == -1)
            first_contents = contents;

        if (contents & 0x600400B && (!(contents & CONTENTS_HITBOX) || first_contents == contents))
            continue;

        new_end = out - (direction * 4.f);

        TraceLine(out, new_end, 0x4600400B, nullptr, &exitTrace);

        if (exitTrace.startsolid && (exitTrace.surface.flags & SURF_HITBOX) != 0)
        {
            TraceLine(out, startPosition, MASK_SHOT_HULL, (player_t*)exitTrace.hit_entity, &exitTrace);

            if (exitTrace.DidHit() && !exitTrace.startsolid)
            {
                out = exitTrace.endpos;
                return true;
            }
            continue;
        }

        if (!exitTrace.DidHit() || exitTrace.startsolid)
        {
            if (enterTrace.hit_entity != m_entitylist()->GetClientEntity(0))
            {
                if (exitTrace.hit_entity && is_breakable_entity(exitTrace.hit_entity))
                {
                    exitTrace.surface.surfaceProps = enterTrace.surface.surfaceProps;
                    exitTrace.endpos = startPosition + direction;
                    return true;
                }
            }

            continue;
        }

        if ((exitTrace.surface.flags & 0x80u) != 0)
        {
            if (enterTrace.hit_entity && is_breakable_entity(enterTrace.hit_entity) && exitTrace.hit_entity && is_breakable_entity(exitTrace.hit_entity))
            {
                out = exitTrace.endpos;
                return true;
            }

            if (!(enterTrace.surface.flags & 0x80u))
                continue;
        }

        if (exitTrace.plane.normal.Dot(direction) <= 1.f)
        {
            out -= direction * (exitTrace.fraction * 4.0f);
            return true;
        }
    }

    return false;
}
 
U не знаю, сколько я благодарю вас так много людей здесь с большим эго я перестал вставлять в 2019 cuz я разозлился один раз и у меня было много помощи от моих друзей теперь я забыл все, что я должен переучить все btw я использую переводчик с английского на русский
Извините, если Google отсталый
 
U не знаю, сколько я благодарю вас так много людей здесь с большим эго я перестал вставлять в 2019 cuz я разозлился один раз и у меня было много помощи от моих друзей теперь я забыл все, что я должен переучить все btw я использую переводчик с английского на русский
Извините, если Google отсталый
wdym, I helped you out. You put this in autowall and ez, I'm not like the rest monkeys that won't help new coders and call them pasters when they don't even know that people like you need help, good day.
 
Назад
Сверху Снизу