From 054904d5cdf735f79fbbb843debcd20375b9a5a9 Mon Sep 17 00:00:00 2001 From: Eugene Date: Fri, 6 Sep 2024 23:30:46 +0300 Subject: [PATCH] misc: improved 'wait' command handling --- code/qcommon/cmd.c | 7 ++++--- code/qcommon/common.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/code/qcommon/cmd.c b/code/qcommon/cmd.c index c5a04222b..2b8d91793 100644 --- a/code/qcommon/cmd.c +++ b/code/qcommon/cmd.c @@ -260,7 +260,6 @@ void Cbuf_Execute( void ) if ( cmd_wait > 0 ) { // delay command buffer execution - cmd_wait--; return; } @@ -357,9 +356,11 @@ void Cbuf_Execute( void ) Cbuf_Wait ============ */ -qboolean Cbuf_Wait( void ) +void Cbuf_Wait( void ) { - return (cmd_wait > 0) ? qtrue : qfalse; + if ( cmd_wait > 0 ) { + --cmd_wait; + } } diff --git a/code/qcommon/common.c b/code/qcommon/common.c index 3186ab37f..ac17e8817 100644 --- a/code/qcommon/common.c +++ b/code/qcommon/common.c @@ -4371,9 +4371,7 @@ void Com_Frame( qboolean noDelay ) { } Com_EventLoop(); - if ( !Cbuf_Wait() ) { - Cbuf_Execute(); - } + Cbuf_Execute(); // // client side @@ -4392,6 +4390,8 @@ void Com_Frame( qboolean noDelay ) { NET_FlushPacketQueue( 0 ); + Cbuf_Wait(); + // // report timing information //