From ef31c77cb10674b19210183120e96b294aef96a7 Mon Sep 17 00:00:00 2001 From: divverent Date: Sun, 4 Jul 2010 19:48:56 +0000 Subject: [PATCH] make -1 as bindmap argument also work, to mean "current bindmap" (same as leaving out). Helps when the user wants to avoid the varargs declaration. From: Rudolf Polzer git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10271 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=a84f88eb529439276164e7b544d275fac5199767 --- keys.c | 2 +- prvm_cmds.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/keys.c b/keys.c index 981e2f24..40ecfde2 100644 --- a/keys.c +++ b/keys.c @@ -1405,7 +1405,7 @@ void Key_FindKeysForCommand (const char *command, int *keys, int numkeys, int bi { int count; int j; - char *b; + const char *b; for (j = 0;j < numkeys;j++) keys[j] = -1; diff --git a/prvm_cmds.c b/prvm_cmds.c index e1c44f04..96f0b452 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -3921,7 +3921,7 @@ void VM_findkeysforcommand(void) cmd = PRVM_G_STRING(OFS_PARM0); if(prog->argc == 2) - bindmap = bound(0, PRVM_G_FLOAT(OFS_PARM1), MAX_BINDMAPS-1); + bindmap = bound(-1, PRVM_G_FLOAT(OFS_PARM1), MAX_BINDMAPS-1); else bindmap = -1; @@ -3962,7 +3962,7 @@ void VM_getkeybind (void) int bindmap; VM_SAFEPARMCOUNTRANGE(1, 2, VM_CL_getkeybind); if(prog->argc == 2) - bindmap = bound(0, PRVM_G_FLOAT(OFS_PARM1), MAX_BINDMAPS-1); + bindmap = bound(-1, PRVM_G_FLOAT(OFS_PARM1), MAX_BINDMAPS-1); else bindmap = -1; -- 2.39.2