@@ -1233,71 +1233,51 @@ void CCore::DoPostFramePulse()
12331233 m_pGUI->SelectInputHandlers (INPUT_CORE);
12341234 }
12351235
1236- if (m_pGame->GetSystemState () == 5 ) // GS_INIT_ONCE
1237- {
1238- WatchDogCompletedSection (" L2" ); // gta_sa.set seems ok
1239- WatchDogCompletedSection (" L3" ); // No hang on startup
1240- }
1241-
12421236 // This is the first frame in the menu?
12431237 if (m_pGame->GetSystemState () == 7 ) // GS_FRONTEND
12441238 {
1245- // Wait 250 frames more than the time it took to get status 7 (fade-out time)
1246- static short WaitForMenu = 0 ;
1239+ if (m_bFirstFrame)
1240+ {
1241+ m_bFirstFrame = false ;
12471242
1248- // Do crash dump encryption while the credit screen is displayed
1249- if (WaitForMenu == 0 )
1243+ WatchDogCompletedSection ( " L2 " ); // gta_sa.set seems ok
1244+ WatchDogCompletedSection ( " L3 " ); // No hang on startup
12501245 HandleCrashDumpEncryption ();
12511246
1252- // Cope with early finish
1253- if (m_pGame->HasCreditScreenFadedOut ())
1254- WaitForMenu = 250 ;
1247+ // Disable vsync while it's all dark
1248+ m_pGame->DisableVSync ();
12551249
1256- if (WaitForMenu >= 250 )
1257- {
1258- if (m_bFirstFrame )
1250+ // Parse the command line
1251+ // Does it begin with mtasa://?
1252+ if (m_szCommandLineArgs && strnicmp (m_szCommandLineArgs, " mtasa:// " , 8 ) == 0 )
12591253 {
1260- m_bFirstFrame = false ;
1261-
1262- // Disable vsync while it's all dark
1263- m_pGame->DisableVSync ();
1264-
1265- // Parse the command line
1266- // Does it begin with mtasa://?
1267- if (m_szCommandLineArgs && strnicmp (m_szCommandLineArgs, " mtasa://" , 8 ) == 0 )
1254+ SString strArguments = GetConnectCommandFromURI (m_szCommandLineArgs);
1255+ // Run the connect command
1256+ if (strArguments.length () > 0 && !m_pCommands->Execute (strArguments))
12681257 {
1269- SString strArguments = GetConnectCommandFromURI (m_szCommandLineArgs);
1270- // Run the connect command
1271- if (strArguments.length () > 0 && !m_pCommands->Execute (strArguments))
1272- {
1273- ShowMessageBox (_ (" Error" ) + _E (" CC41" ), _ (" Error executing URL" ), MB_BUTTON_OK | MB_ICON_ERROR);
1274- }
1258+ ShowMessageBox (_ (" Error" ) + _E (" CC41" ), _ (" Error executing URL" ), MB_BUTTON_OK | MB_ICON_ERROR);
12751259 }
1276- else
1260+ }
1261+ else
1262+ {
1263+ // We want to load a mod?
1264+ const char * szOptionValue;
1265+ if (szOptionValue = GetCommandLineOption (" l" ))
12771266 {
1278- // We want to load a mod?
1279- const char * szOptionValue;
1280- if (szOptionValue = GetCommandLineOption (" l" ))
1281- {
1282- // Try to load the mod
1283- if (!m_pModManager->Load (szOptionValue, m_szCommandLineArgs))
1284- {
1285- SString strTemp (_ (" Error running mod specified in command line ('%s')" ), szOptionValue);
1286- ShowMessageBox (_ (" Error" ) + _E (" CC42" ), strTemp, MB_BUTTON_OK | MB_ICON_ERROR); // Command line Mod load failed
1287- }
1288- }
1289- // We want to connect to a server?
1290- else if (szOptionValue = GetCommandLineOption (" c" ))
1267+ // Try to load the mod
1268+ if (!m_pModManager->Load (szOptionValue, m_szCommandLineArgs))
12911269 {
1292- CCommandFuncs::Connect (szOptionValue);
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
12931272 }
12941273 }
1274+ // We want to connect to a server?
1275+ else if (szOptionValue = GetCommandLineOption (" c" ))
1276+ {
1277+ CCommandFuncs::Connect (szOptionValue);
1278+ }
12951279 }
12961280 }
1297- else
1298- {
1299- WaitForMenu++;
1300- }
13011281
13021282 if (m_bWaitToSetNick && GetLocalGUI ()->GetMainMenu ()->IsVisible () && !GetLocalGUI ()->GetMainMenu ()->IsFading ())
13031283 {
0 commit comments