Вопрос Проблема с функцией edgebug

Начинающий
Статус
Оффлайн
Регистрация
18 Авг 2020
Сообщения
10
Реакции[?]
0
Поинты[?]
0
детектит edgebug но плохо ведет до конца текстуры
ведет перед концом текстуры

Код:
    if (!edge::detection) {
        backup.move = vec2_t(cmd->forwardmove, cmd->sidemove);
        backup.buttons = cmd->buttons;

        for (int pre_ticks = 0; pre_ticks < 2; pre_ticks++) {
            interfaces::prediction->restore_predict();

            int flags = local_player->get_flags();
            vec3_t velocity = local_player->get_velocity();

            for (int ticks = 0; ticks < 32; ticks++) {

                if (pre_ticks == 1) {
                    edge::duck = true;
                    cmd->buttons |= in_duck;
                }
                else {
                    edge::duck = false;
                    cmd->buttons &= ~in_duck;
                }

                cmd->forwardmove = 0.f;
                cmd->sidemove = 0.f;

                if (flags & fl_onground || velocity.z > 0.f || (int)roundf(velocity.z) == 0.0)
                    break;

                engine_predict::start(local_player, cmd);
                engine_predict::end(local_player);

                if (is_edgebug(velocity, local_player->get_velocity())) {
                    edge::edge_ticks = cmd->tick_count + (ticks + 1);
                    edge::detection = true;
                    break;
                }

                if (local_player->get_flags() & fl_onground  || local_player->get_velocity().z > 0.f || (int)roundf(local_player->get_velocity().z) == 0.0)
                    break;

                flags = local_player->get_flags();
                velocity = local_player->get_velocity();
            }
        }
        cmd->buttons = backup.buttons;
        cmd->forwardmove = backup.move.x;
        cmd->sidemove = backup.move.y;
    }
    if (edge::detection) {
        if (edge::edge_ticks < cmd->tick_count || engine_predict::old_flags & fl_onground) {
            edge::detection = false;
            return;
        }

        cmd->forwardmove = 0.f;
        cmd->sidemove = 0.f;

        return;
    }
 
Сверху Снизу