@@ -117,13 +117,11 @@ CCore::CCore()
117117 m_pfnMessageProcessor = NULL ;
118118 m_pMessageBox = NULL ;
119119
120- m_bFirstFrame = true ;
121120 m_bIsOfflineMod = false ;
122121 m_bQuitOnPulse = false ;
123122 m_bDestroyMessageBox = false ;
124123 m_bCursorToggleControls = false ;
125124 m_bLastFocused = true ;
126- m_bWaitToSetNick = false ;
127125 m_DiagnosticDebug = EDiagnosticDebug::NONE;
128126
129127 // Create our Direct3DData handler.
@@ -151,7 +149,6 @@ CCore::CCore()
151149 m_bDoneFrameRateLimit = false ;
152150 m_uiFrameRateLimit = 0 ;
153151 m_uiServerFrameRateLimit = 0 ;
154- m_uiNewNickWaitFrames = 0 ;
155152 m_iUnminimizeFrameCounter = 0 ;
156153 m_bDidRecreateRenderTargets = false ;
157154 m_fMinStreamingMemory = 0 ;
@@ -515,7 +512,7 @@ void CCore::EnableChatInput(char* szCommand, DWORD dwColor)
515512{
516513 if (m_pLocalGUI)
517514 {
518- if (m_pGame->GetSystemState () == 9 /* GS_PLAYING_GAME */ && m_pModManager->GetCurrentMod () != NULL && !IsOfflineMod () && !m_pGame->IsAtMenu () &&
515+ if (m_pGame->GetSystemState () == 9 /* GS_PLAYING_GAME */ && m_pModManager->IsLoaded () && !IsOfflineMod () && !m_pGame->IsAtMenu () &&
519516 !m_pLocalGUI->GetMainMenu ()->IsVisible () && !m_pLocalGUI->GetConsole ()->IsVisible () && !m_pLocalGUI->IsChatBoxInputEnabled ())
520517 {
521518 CChat* pChat = m_pLocalGUI->GetChat ();
@@ -1236,16 +1233,22 @@ void CCore::DoPostFramePulse()
12361233 // This is the first frame in the menu?
12371234 if (m_pGame->GetSystemState () == 7 ) // GS_FRONTEND
12381235 {
1239- if (m_bFirstFrame)
1240- {
1241- m_bFirstFrame = false ;
1236+ if (m_menuFrame < 255 )
1237+ ++m_menuFrame;
12421238
1239+ if (m_menuFrame == 1 )
1240+ {
12431241 WatchDogCompletedSection (" L2" ); // gta_sa.set seems ok
12441242 WatchDogCompletedSection (" L3" ); // No hang on startup
12451243 HandleCrashDumpEncryption ();
12461244
12471245 // Disable vsync while it's all dark
12481246 m_pGame->DisableVSync ();
1247+ }
1248+
1249+ if (m_menuFrame >= 5 && !m_isNetworkReady && m_pNet->IsReady ())
1250+ {
1251+ m_isNetworkReady = true ;
12491252
12501253 // Parse the command line
12511254 // Does it begin with mtasa://?
@@ -1262,33 +1265,18 @@ void CCore::DoPostFramePulse()
12621265 {
12631266 // We want to load a mod?
12641267 const char * szOptionValue;
1265- if (szOptionValue = GetCommandLineOption (" l" ))
1266- {
1267- // Try to load the mod
1268- if (!m_pModManager->Load (szOptionValue, m_szCommandLineArgs))
1269- {
1270- SString strTemp (_ (" Error running mod specified in command line ('%s')" ), szOptionValue);
1271- ShowMessageBox (_ (" Error" ) + _E (" CC42" ), strTemp, MB_BUTTON_OK | MB_ICON_ERROR); // Command line Mod load failed
1272- }
1273- }
1274- // We want to connect to a server?
1275- else if (szOptionValue = GetCommandLineOption (" c" ))
1268+ if (szOptionValue = GetCommandLineOption (" c" ))
12761269 {
12771270 CCommandFuncs::Connect (szOptionValue);
12781271 }
12791272 }
12801273 }
12811274
1282- if (m_bWaitToSetNick && GetLocalGUI ()->GetMainMenu ()->IsVisible () && !GetLocalGUI ()->GetMainMenu ()->IsFading ())
1275+ if (m_menuFrame >= 75 && m_requestNewNickname && GetLocalGUI ()->GetMainMenu ()->IsVisible () && !GetLocalGUI ()->GetMainMenu ()->IsFading ())
12831276 {
1284- if (m_uiNewNickWaitFrames > 75 )
1285- {
1286- // Request a new nickname if we're waiting for one
1287- GetLocalGUI ()->GetMainMenu ()->GetSettingsWindow ()->RequestNewNickname ();
1288- m_bWaitToSetNick = false ;
1289- }
1290- else
1291- m_uiNewNickWaitFrames++;
1277+ // Request a new nickname if we're waiting for one
1278+ GetLocalGUI ()->GetMainMenu ()->GetSettingsWindow ()->RequestNewNickname ();
1279+ m_requestNewNickname = false ;
12921280 }
12931281 }
12941282
@@ -2195,8 +2183,9 @@ void CCore::HandleIdlePulse()
21952183 DoPreFramePulse ();
21962184 DoPostFramePulse ();
21972185 }
2198- if (m_pModManager->GetCurrentMod ())
2199- m_pModManager->GetCurrentMod ()->IdleHandler ();
2186+
2187+ if (m_pModManager->IsLoaded ())
2188+ m_pModManager->GetClient ()->IdleHandler ();
22002189}
22012190
22022191//
0 commit comments