2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2025-01-10 10:25:37 +01:00

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

This commit is contained in:
Alibek Omarov 2022-12-13 10:54:03 +03:00
parent af7d6f6fa8
commit 07afbd64d4

View File

@ -286,14 +286,14 @@ static int Host_CalcSleep( void )
// let the dedicated server some sleep
return host_sleeptime->value;
}
else if( host.status == HOST_NOFOCUS )
{
if( SV_Active() && CL_IsInGame( ))
return host_sleeptime->value; // listenserver
return 20; // sleep 20 ms otherwise
}
else if( host.status == HOST_SLEEP )
switch( host.status )
{
case HOST_NOFOCUS:
if( SV_Active() && CL_IsInGame())
return host_sleeptime->value;
// fallthrough
case HOST_SLEEP:
return 20;
}
@ -1229,6 +1229,10 @@ int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGa
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 )
Con_Printf( "Type 'map <mapname>' to start game... (TAB-autocomplete is working too)\n" );