make -1 as bindmap argument also work, to mean "current bindmap" (same as leaving...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 4 Jul 2010 19:48:56 +0000 (19:48 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 4 Jul 2010 19:48:56 +0000 (19:48 +0000)
From: Rudolf Polzer <divverent@alientrap.org>

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10271 d7cf8633-e32d-0410-b094-e92efae38249

keys.c
prvm_cmds.c

diff --git a/keys.c b/keys.c
index 981e2f2..40ecfde 100644 (file)
--- 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;
index 2ddf0af..0781f0e 100644 (file)
@@ -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;