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

Вопрос GetLocalPlayerController crash

  • Автор темы Автор темы VeloHvH
  • Дата начала Дата начала
Начинающий
Начинающий
Статус
Оффлайн
Регистрация
26 Ноя 2020
Сообщения
62
Реакции
10
When debugging i get a read access violation here. Sig is Updated
1726016378957.png
 
it's better to do it not through a pattern, but through vfunc
code:
Код:
Expand Collapse Copy
CCSPlayerController* CCSPlayerController::GetLocalPlayerController()
{
    const int index = interfaces::engine->GetLocalPlayer();
    return interfaces::game_resource_service->pGameEntitySystem->Get<CCSPlayerController>(index);
}
Код:
Expand Collapse Copy
    int GetLocalPlayer()
    {
        int index = -1;

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

        return index + 1;
    }
 
[QUOTE = "z1nteex, post: 3149010, member: 1259234"]
it's better to do it not through a pattern, but through vfunc
code:
Код:
Expand Collapse Copy
 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
 
Назад
Сверху Снизу