Вопрос Помощь с IsVisible

Начинающий
Статус
Оффлайн
Регистрация
6 Авг 2021
Сообщения
6
Реакции[?]
0
Поинты[?]
0
Кто-нибудь может помочь с IsVisible? Есть такой код, но всегда возвращает false. Пробовал смещение 280, наоборот всегда true...Было норм, но в последних обновах что-то поменяли, теперь не робит.


C++:
bool IsVisible(Vec3 at, Vec3 to)
{
    RayHit hit;
    return !SSGE::Singleton()->GetIPhysicalWorld()->RayWorldIntersection(to, at - to, 0x100 | 0x1, 0xA | 0x400, &hit, 1);
}
C++:
int RayWorldIntersection(const Vec3& org, const Vec3& dir, int objtypes, unsigned int flags, RayHit* hits, int nMaxHits, IPhysicalEntity** pSkipEnts = 0, int nSkipEnts = 0, void* pForeignData = 0, int iForeignData = 0, const char* pNameTag = XorStr("RayWorldIntersection(Game)"), RayHitCached* phitLast = 0, int iCaller = 4)
    {
        using oRayWorldIntersection = int(__fastcall*)(PVOID, const Vec3&, const Vec3&, int, unsigned int, RayHit*, int, IPhysicalEntity**, int, void*, int, const char*, RayHitCached*, int);

        return virindex<oRayWorldIntersection>(this, 776)(this, org, dir, objtypes, flags, hits, nMaxHits, pSkipEnts,
            nSkipEnts, pForeignData, iForeignData, pNameTag, phitLast, iCaller);
    }
 
EVOLUTION ?
Забаненный
Статус
Оффлайн
Регистрация
30 Июл 2019
Сообщения
1,162
Реакции[?]
269
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Кто-нибудь может помочь с IsVisible? Есть такой код, но всегда возвращает false. Пробовал смещение 280, наоборот всегда true...Было норм, но в последних обновах что-то поменяли, теперь не робит.


C++:
bool IsVisible(Vec3 at, Vec3 to)
{
    RayHit hit;
    return !SSGE::Singleton()->GetIPhysicalWorld()->RayWorldIntersection(to, at - to, 0x100 | 0x1, 0xA | 0x400, &hit, 1);
}
C++:
    int RayWorldIntersection(const Vec3& org, const Vec3& dir, int objtypes, unsigned int flags, RayHit* hits, int nMaxHits, IPhysicalEntity** pSkipEnts = 0, int nSkipEnts = 0, void* pForeignData = 0, int iForeignData = 0, const char* pNameTag = XorStr("RayWorldIntersection(Game)"), RayHitCached* phitLast = 0, int iCaller = 4)
    {
        using oRayWorldIntersection = int(__fastcall*)(PVOID, const Vec3&, const Vec3&, int, unsigned int, RayHit*, int, IPhysicalEntity**, int, void*, int, const char*, RayHitCached*, int);

        return virindex<oRayWorldIntersection>(this, 776)(this, org, dir, objtypes, flags, hits, nMaxHits, pSkipEnts,
            nSkipEnts, pForeignData, iForeignData, pNameTag, phitLast, iCaller);
    }
C++:
int ray_world_intersection(const Vec3& org, const Vec3& dir, int objtypes, unsigned int flags, CRayHit* hits, int nMaxHits, c_physical_entity** pSkipEnts = 0, int nSkipEnts = 0, void* pForeignData = 0, int iForeignData = 0, const char* pNameTag = "RayWorldIntersection(Game)", CRayHitCached* phitLast = 0, int iCaller = 4)
    {
        using oRayWorldIntersection = int(__fastcall*)(PVOID, const Vec3&, const Vec3&, int, unsigned int, CRayHit*, int, c_physical_entity**, int, void*, int, const char*, CRayHitCached*, int);
        return hook<oRayWorldIntersection>(this, 97)(this, org, dir, objtypes, flags, hits, nMaxHits, pSkipEnts, nSkipEnts, pForeignData, iForeignData, pNameTag, phitLast, iCaller);
    }
    bool is_visible(Vec3 shootPos, Vec3 pos)
    {
        CRayHit tmpHit;
        return !this->ray_world_intersection(shootPos, pos - shootPos, 0x100 | 1, 0xA | 0x400, &tmpHit, 1);
    }
 
Начинающий
Статус
Оффлайн
Регистрация
6 Авг 2021
Сообщения
6
Реакции[?]
0
Поинты[?]
0
Метод virindex в этой строке, как раз и вычисляет индекс из оффсета 776, деля его на 8.
C++:
template <class T>
T virindex(PVOID pVoid, __int64 i64Index) { return (*(T**)pVoid)[i64Index / 8]; }
C++:
return virindex<oRayWorldIntersection>(this, 776)(this, org, dir, objtypes, flags, hits, nMaxHits, pSkipEnts,
            nSkipEnts, pForeignData, iForeignData, pNameTag, phitLast, iCaller);
Возможно изменились вот эти флаги?


(shootPos, pos - shootPos, 0x100 | 1, 0xA | 0x400, &tmpHit, 1);
 
Начинающий
Статус
Оффлайн
Регистрация
6 Авг 2021
Сообщения
6
Реакции[?]
0
Поинты[?]
0
Проблема была в позиции стрелка. Решено.
Всем спс, кто не прошел мимо.
 
Сверху Снизу