diff --git a/code/qcommon/common.c b/code/qcommon/common.c index ac17e8817..c30ebbe39 100644 --- a/code/qcommon/common.c +++ b/code/qcommon/common.c @@ -3746,6 +3746,9 @@ void Com_Init( char *commandLine ) { const char *s; int qport; + // get the initial time base + Sys_Milliseconds(); + Com_Printf( "%s %s %s\n", SVN_VERSION, PLATFORM_STRING, __DATE__ ); if ( Q_setjmp( abortframe ) ) { @@ -4011,7 +4014,8 @@ void Com_Init( char *commandLine ) { // set com_frameTime so that if a map is started on the // command line it will still be able to count on com_frameTime // being random enough for a serverid - lastTime = com_frameTime = Com_Milliseconds(); + // lastTime = com_frameTime = Com_Milliseconds(); + Com_FrameInit(); if ( !com_errorEntered ) Sys_ShowConsole( com_viewlog->integer, qfalse ); @@ -4024,6 +4028,10 @@ void Com_Init( char *commandLine ) { com_fullyInitialized = qtrue; Com_Printf( "--- Common Initialization Complete ---\n" ); + + NET_Init(); + + Com_Printf( "Working directory: %s\n", Sys_Pwd() ); } @@ -4186,6 +4194,15 @@ static int Com_TimeVal( int minMsec ) return timeVal; } +/* +================= +Com_FrameInit +================= +*/ +void Com_FrameInit( void ) +{ + lastTime = com_frameTime = Com_Milliseconds(); +} /* ================= diff --git a/code/qcommon/qcommon.h b/code/qcommon/qcommon.h index fabbab471..458bf5dd4 100644 --- a/code/qcommon/qcommon.h +++ b/code/qcommon/qcommon.h @@ -1125,6 +1125,7 @@ unsigned int Com_TouchMemory( void ); // commandLine should not include the executable name (argv[0]) void Com_Init( char *commandLine ); +void Com_FrameInit( void ); void Com_Frame( qboolean noDelay ); /* diff --git a/code/server/sv_init.c b/code/server/sv_init.c index fa222f547..2a928a48a 100644 --- a/code/server/sv_init.c +++ b/code/server/sv_init.c @@ -680,6 +680,9 @@ void SV_SpawnServer( const char *mapname, qboolean killBots ) { Com_Printf ("-----------------------------------\n"); Sys_SetStatus( "Running map %s", mapname ); + + // suppress hitch warning + Com_FrameInit(); } diff --git a/code/unix/unix_main.c b/code/unix/unix_main.c index ffe716f5b..8a2d704e5 100644 --- a/code/unix/unix_main.c +++ b/code/unix/unix_main.c @@ -1023,13 +1023,7 @@ int main( int argc, const char* argv[] ) // memset( &eventQue[0], 0, sizeof( eventQue ) ); // memset( &sys_packetReceived[0], 0, sizeof( sys_packetReceived ) ); - // get the initial time base - Sys_Milliseconds(); - Com_Init( cmdline ); - NET_Init(); - - Com_Printf( "Working directory: %s\n", Sys_Pwd() ); // Sys_ConsoleInputInit() might be called in signal handler // so modify/init any cvars here diff --git a/code/win32/win_main.c b/code/win32/win_main.c index 1235c7ec0..4d6a7e523 100644 --- a/code/win32/win_main.c +++ b/code/win32/win_main.c @@ -808,13 +808,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin SetUnhandledExceptionFilter( ExceptionFilter ); - // get the initial time base - Sys_Milliseconds(); - Com_Init( sys_cmdline ); - NET_Init(); - - Com_Printf( "Working directory: %s\n", Sys_Pwd() ); // hide the early console since we've reached the point where we // have a working graphics subsystems