diff options
author | Tim Angus <tim@ngus.net> | 2006-01-20 23:33:57 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2006-01-20 23:33:57 +0000 |
commit | ba69ac8d95b7a05fbaf12209785492e3500f1117 (patch) | |
tree | 9727b0251042509f5bdf2b76b8d28a568d1a0fdb /src/cgame | |
parent | 5b13e23b457831b881db4e80deb41fbf5d1190e1 (diff) |
* Fixed a couple of subtle bugs in the tutorial system
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_tutorial.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cgame/cg_tutorial.c b/src/cgame/cg_tutorial.c index f54786be..8439f34a 100644 --- a/src/cgame/cg_tutorial.c +++ b/src/cgame/cg_tutorial.c @@ -64,7 +64,7 @@ static void CG_GetBindings( void ) for( i = 0; i < numBindings; i++ ) { - bindings[ i ].keys[ 0 ] = bindings[ i ].keys[ 1 ] = -1; + bindings[ i ].keys[ 0 ] = bindings[ i ].keys[ 1 ] = K_NONE; numKeys = 0; for( j = 0; j < K_LAST_KEY; j++ ) @@ -102,7 +102,7 @@ static const char *CG_KeyNameForCommand( const char *command ) { if( !Q_stricmp( command, bindings[ i ].command ) ) { - if( bindings[ i ].keys[ 0 ] >= 0 ) + if( bindings[ i ].keys[ 0 ] != K_NONE ) { trap_Key_KeynumToStringBuf( bindings[ i ].keys[ 0 ], buffer, MAX_STRING_CHARS ); @@ -111,11 +111,11 @@ static const char *CG_KeyNameForCommand( const char *command ) for( j = 0; j < firstKeyLength; j++ ) buffer[ j ] = toupper( buffer[ j ] ); - if( bindings[ i ].keys[ 1 ] >= 0 ) + if( bindings[ i ].keys[ 1 ] != K_NONE ) { Q_strcat( buffer, MAX_STRING_CHARS, " or " ); trap_Key_KeynumToStringBuf( bindings[ i ].keys[ 1 ], - buffer + strlen( buffer ), MAX_STRING_CHARS ); + buffer + strlen( buffer ), MAX_STRING_CHARS - strlen( buffer ) ); for( j = firstKeyLength + 4; j < strlen( buffer ); j++ ) buffer[ j ] = toupper( buffer[ j ] ); |