aboutsummaryrefslogtreecommitdiffstats
path: root/code/client/cl_keys.c
diff options
context:
space:
mode:
authortjw <tjw@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-03-22 22:03:00 +0000
committertjw <tjw@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-03-22 22:03:00 +0000
commita3ece0ec269afc8ec40b7d1ffb987327ce4e2d9b (patch)
treeed19c244e2da56b8b033c001ff0f49f398b1f6e7 /code/client/cl_keys.c
parent413d880b8aedeeb4f0f4a4c27fa4b6a1a0d31300 (diff)
downloadioquake3-aero-a3ece0ec269afc8ec40b7d1ffb987327ce4e2d9b.tar.gz
ioquake3-aero-a3ece0ec269afc8ec40b7d1ffb987327ce4e2d9b.zip
* (bug 2741) replace K_LAST_KEY with MAX_KEYS. K_LAST_KEY is now defined
at 256 for mod compatability reasons. ioq3-only mods may chose to use MAX_KEYS for checking binds in order to get full key support, but at the cost of breaking compatability with older clients. * (bug 2741) remove some lingering 256-key hardcoding * properly check bounds of keynum in Key_IsDown(), Key_SetBinding(), and Key_GetBinding() git-svn-id: svn://svn.icculus.org/quake3/trunk@1053 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/client/cl_keys.c')
-rw-r--r--code/client/cl_keys.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/code/client/cl_keys.c b/code/client/cl_keys.c
index acfe951..a518807 100644
--- a/code/client/cl_keys.c
+++ b/code/client/cl_keys.c
@@ -782,7 +782,7 @@ Key_IsDown
===================
*/
qboolean Key_IsDown( int keynum ) {
- if ( keynum == -1 ) {
+ if ( keynum < 0 || keynum >= MAX_KEYS ) {
return qfalse;
}
@@ -902,7 +902,7 @@ Key_SetBinding
===================
*/
void Key_SetBinding( int keynum, const char *binding ) {
- if ( keynum == -1 ) {
+ if ( keynum < 0 || keynum >= MAX_KEYS ) {
return;
}
@@ -926,7 +926,7 @@ Key_GetBinding
===================
*/
char *Key_GetBinding( int keynum ) {
- if ( keynum == -1 ) {
+ if ( keynum < 0 || keynum >= MAX_KEYS ) {
return "";
}
@@ -943,7 +943,7 @@ int Key_GetKey(const char *binding) {
int i;
if (binding) {
- for (i=0 ; i<256 ; i++) {
+ for (i=0 ; i < MAX_KEYS ; i++) {
if (keys[i].binding && Q_stricmp(binding, keys[i].binding) == 0) {
return i;
}
@@ -986,7 +986,7 @@ void Key_Unbindall_f (void)
{
int i;
- for (i=0 ; i<256 ; i++)
+ for (i=0 ; i < MAX_KEYS; i++)
if (keys[i].binding)
Key_SetBinding (i, "");
}