Skip to content

Commit

Permalink
server: suppress false hitch warning during map load
Browse files Browse the repository at this point in the history
  • Loading branch information
ec- committed Sep 21, 2024
1 parent d3dd892 commit da163fa
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
19 changes: 18 additions & 1 deletion code/qcommon/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ) {
Expand Down Expand Up @@ -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 );
Expand All @@ -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() );
}


Expand Down Expand Up @@ -4186,6 +4194,15 @@ static int Com_TimeVal( int minMsec )
return timeVal;
}

/*
=================
Com_FrameInit
=================
*/
void Com_FrameInit( void )
{
lastTime = com_frameTime = Com_Milliseconds();
}

/*
=================
Expand Down
1 change: 1 addition & 0 deletions code/qcommon/qcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

/*
Expand Down
3 changes: 3 additions & 0 deletions code/server/sv_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}


Expand Down
6 changes: 0 additions & 6 deletions code/unix/unix_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions code/win32/win_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit da163fa

Please sign in to comment.