/* ======================== Sys_ReLaunch ======================== */ void Sys_ReLaunch() { TCHAR szPathOrig[MAX_PRINT_MSG]; STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); // DG: we don't have function arguments in Sys_ReLaunch() anymore, everyone only passed // the command-line +" +set com_skipIntroVideos 1" anyway and it was painful on POSIX systems // so let's just add it here. idStr cmdLine = Sys_GetCmdLine(); if( cmdLine.Find( "com_skipIntroVideos" ) < 0 ) { cmdLine.Append( " +set com_skipIntroVideos 1" ); } strcpy( szPathOrig, va( "\"%s\" %s", Sys_EXEPath(), cmdLine.c_str() ) ); // DG end CloseHandle( hProcessMutex ); if ( !CreateProcess( NULL, szPathOrig, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ) ) { idLib::Error( "Could not start process: '%s' ", szPathOrig ); return; } cmdSystem->AppendCommandText( "quit\n" ); }
idSWFScriptVar Call( idSWFScriptObject * thisObject, const idSWFParmList & parms ) { common->Dialog().ClearDialog( msg ); if ( restart ) { idStr cmdLine = Sys_GetCmdLine(); if ( cmdLine.Find( "com_skipIntroVideos" ) < 0 ) { cmdLine.Append( " +set com_skipIntroVideos 1" ); } Sys_ReLaunch( (void*)cmdLine.c_str(), cmdLine.Length() ); } return idSWFScriptVar(); }