Browse Source

engine: common: host: force set HOST_FRAME status for dedicated as it finished initializing

pull/2/head
Alibek Omarov 2 years ago
parent
commit
07afbd64d4
  1. 16
      engine/common/host.c

16
engine/common/host.c

@ -286,14 +286,14 @@ static int Host_CalcSleep( void )
// let the dedicated server some sleep // let the dedicated server some sleep
return host_sleeptime->value; return host_sleeptime->value;
} }
else if( host.status == HOST_NOFOCUS )
switch( host.status )
{ {
case HOST_NOFOCUS:
if( SV_Active() && CL_IsInGame()) if( SV_Active() && CL_IsInGame())
return host_sleeptime->value; // listenserver return host_sleeptime->value;
return 20; // sleep 20 ms otherwise // fallthrough
} case HOST_SLEEP:
else if( host.status == HOST_SLEEP )
{
return 20; return 20;
} }
@ -1229,6 +1229,10 @@ int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGa
if( Host_IsDedicated( )) if( Host_IsDedicated( ))
{ {
// in dedicated server input system can't set HOST_FRAME status
// so set it here as we're finished initializing
host.status = HOST_FRAME;
if( GameState->nextstate == STATE_RUNFRAME ) if( GameState->nextstate == STATE_RUNFRAME )
Con_Printf( "Type 'map <mapname>' to start game... (TAB-autocomplete is working too)\n" ); Con_Printf( "Type 'map <mapname>' to start game... (TAB-autocomplete is working too)\n" );

Loading…
Cancel
Save