From fc7e0e6c8b27702f1d769459e4895f47710e1b29 Mon Sep 17 00:00:00 2001 From: slashkeyvalue Date: Fri, 16 Feb 2024 13:43:22 -0300 Subject: [PATCH] tweak(glue): when using "fivem://connect", attempt to connect to server earlier --- code/components/glue/src/ConnectToNative.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/code/components/glue/src/ConnectToNative.cpp b/code/components/glue/src/ConnectToNative.cpp index 78d3c39230..142222dfa5 100644 --- a/code/components/glue/src/ConnectToNative.cpp +++ b/code/components/glue/src/ConnectToNative.cpp @@ -1477,14 +1477,11 @@ void Component_RunPreInit() { // #TODOLIBERTY: ? #ifndef GTA_NY - rage::OnInitFunctionStart.Connect([](rage::InitFunctionType type) + NetLibrary::OnNetLibraryCreate.Connect([](NetLibrary*) { - if (type == rage::InitFunctionType::INIT_CORE) - { - ConnectTo(connectHost, false, connectParams); - connectHost = ""; - connectParams = ""; - } + ConnectTo(connectHost, false, connectParams); + connectHost = ""; + connectParams = ""; }, 999999); #endif }