mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-10 07:11:46 +00:00
Don't allow negative arguments to the "wait" console command.
This commit is contained in:
parent
94657a2a2a
commit
76b7468a9d
1 changed files with 3 additions and 1 deletions
|
@ -52,6 +52,8 @@ bind g "cmd use rocket ; +attack ; wait ; -attack ; cmd use blaster"
|
||||||
void Cmd_Wait_f( void ) {
|
void Cmd_Wait_f( void ) {
|
||||||
if ( Cmd_Argc() == 2 ) {
|
if ( Cmd_Argc() == 2 ) {
|
||||||
cmd_wait = atoi( Cmd_Argv( 1 ) );
|
cmd_wait = atoi( Cmd_Argv( 1 ) );
|
||||||
|
if ( cmd_wait < 0 )
|
||||||
|
cmd_wait = 1; // ignore the argument
|
||||||
} else {
|
} else {
|
||||||
cmd_wait = 1;
|
cmd_wait = 1;
|
||||||
}
|
}
|
||||||
|
@ -176,7 +178,7 @@ void Cbuf_Execute (void)
|
||||||
|
|
||||||
while (cmd_text.cursize)
|
while (cmd_text.cursize)
|
||||||
{
|
{
|
||||||
if ( cmd_wait ) {
|
if ( cmd_wait > 0 ) {
|
||||||
// skip out while text still remains in buffer, leaving it
|
// skip out while text still remains in buffer, leaving it
|
||||||
// for next frame
|
// for next frame
|
||||||
cmd_wait--;
|
cmd_wait--;
|
||||||
|
|
Loading…
Reference in a new issue