From 07afbd64d4a687cec8979cb8befcc0ca437e274e Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 13 Dec 2022 10:54:03 +0300 Subject: [PATCH] engine: common: host: force set HOST_FRAME status for dedicated as it finished initializing --- engine/common/host.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/engine/common/host.c b/engine/common/host.c index 13a12e38..3de404a3 100644 --- a/engine/common/host.c +++ b/engine/common/host.c @@ -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 ' to start game... (TAB-autocomplete is working too)\n" );