Skip to content

Commit

Permalink
misc: improved 'wait' command handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ec- committed Sep 6, 2024
1 parent b6e7ce4 commit 054904d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions code/qcommon/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ void Cbuf_Execute( void )

if ( cmd_wait > 0 ) {
// delay command buffer execution
cmd_wait--;
return;
}

Expand Down Expand Up @@ -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;
}
}


Expand Down
6 changes: 3 additions & 3 deletions code/qcommon/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -4371,9 +4371,7 @@ void Com_Frame( qboolean noDelay ) {
}
Com_EventLoop();

if ( !Cbuf_Wait() ) {
Cbuf_Execute();
}
Cbuf_Execute();

//
// client side
Expand All @@ -4392,6 +4390,8 @@ void Com_Frame( qboolean noDelay ) {

NET_FlushPacketQueue( 0 );

Cbuf_Wait();

//
// report timing information
//
Expand Down

0 comments on commit 054904d

Please sign in to comment.