Skip to content

Commit

Permalink
Don't allow negative arguments to the "wait" console command.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 14, 2009
1 parent 94657a2 commit 76b7468
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/qcommon/cmd.c
Expand Up @@ -52,6 +52,8 @@ bind g "cmd use rocket ; +attack ; wait ; -attack ; cmd use blaster"
void Cmd_Wait_f( void ) {
if ( Cmd_Argc() == 2 ) {
cmd_wait = atoi( Cmd_Argv( 1 ) );
if ( cmd_wait < 0 )
cmd_wait = 1; // ignore the argument
} else {
cmd_wait = 1;
}
Expand Down Expand Up @@ -176,7 +178,7 @@ void Cbuf_Execute (void)

while (cmd_text.cursize)
{
if ( cmd_wait ) {
if ( cmd_wait > 0 ) {
// skip out while text still remains in buffer, leaving it
// for next frame
cmd_wait--;
Expand Down

0 comments on commit 76b7468

Please sign in to comment.