Вопрос GetLocalPlayerController crash

Начинающий
Статус
Оффлайн
Регистрация
29 Апр 2024
Сообщения
113
Реакции[?]
9
Поинты[?]
9K
it's better to do it not through a pattern, but through vfunc
code:
Код:
CCSPlayerController* CCSPlayerController::GetLocalPlayerController()
{
    const int index = interfaces::engine->GetLocalPlayer();
    return interfaces::game_resource_service->pGameEntitySystem->Get<CCSPlayerController>(index);
}
Код:
    int GetLocalPlayer()
    {
        int index = -1;

        memory::vfunc<void, 47U>(this, std::ref(index), 0);

        return index + 1;
    }
 
Начинающий
Статус
Оффлайн
Регистрация
26 Ноя 2020
Сообщения
62
Реакции[?]
10
Поинты[?]
2K
[QUOTE = "z1nteex, post: 3149010, member: 1259234"]
it's better to do it not through a pattern, but through vfunc
code:
Код:
 CCSPlayerController * CCSPlayerController :: GetLocalPlayerController ()
{
    const int index = interfaces :: engine- > GetLocalPlayer ();
    return interfaces :: game_resource_service- > pGameEntitySystem- > Get < CCSPlayerController > (index);
}[/ CODE]
[CODE]
    int GetLocalPlayer ()
    {
        int index = -1;

        memory :: vfunc < void, 47U > (this, std :: ref (index), 0);

        return index + 1;
    }

[/ CODE]
[/ QUOTE]
thanks bro
 
Сверху Снизу