Fix crash with nvidia overlay

This commit is contained in:
Grinch_ 2021-07-09 15:02:54 +06:00
parent a7e69d0d05
commit b082a6da30
4 changed files with 11 additions and 10 deletions

View File

@ -166,20 +166,20 @@ Hook::Hook()
{ {
ImGui::CreateContext(); ImGui::CreateContext();
// gtaRenderHook
if (init(kiero::RenderType::D3D11) == kiero::Status::Success)
{
Globals::renderer = Render_DirectX11;
kiero::bind(8, (void**)&oPresent11, Dx11Handler);
}
else
{
if (init(kiero::RenderType::D3D9) == kiero::Status::Success) if (init(kiero::RenderType::D3D9) == kiero::Status::Success)
{ {
Globals::renderer = Render_DirectX9; Globals::renderer = Render_DirectX9;
kiero::bind(16, (void**)&oReset, Reset); kiero::bind(16, (void**)&oReset, Reset);
kiero::bind(42, (void**)&oEndScene, Dx9Handler); kiero::bind(42, (void**)&oEndScene, Dx9Handler);
} }
else
{
// gtaRenderHook
if (init(kiero::RenderType::D3D11) == kiero::Status::Success)
{
Globals::renderer = Render_DirectX11;
kiero::bind(8, (void**)&oPresent11, Dx11Handler);
}
} }
} }

View File

@ -8,6 +8,7 @@ Vehicle::Vehicle()
{ {
ParseVehiclesIDE(); ParseVehiclesIDE();
ParseCarcolsDAT(); ParseCarcolsDAT();
Events::processScriptsEvent += [this] Events::processScriptsEvent += [this]
{ {
if (!m_bImagesLoaded) if (!m_bImagesLoaded)

View File

@ -93,7 +93,7 @@ struct STextureStructure
{ {
std::string m_FileName; std::string m_FileName;
std::string m_CategoryName; std::string m_CategoryName;
void* m_pTexture; void* m_pTexture = nullptr;
}; };
struct HotKeyData struct HotKeyData