mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: client: simplified strings operations.
This commit is contained in:
committed by
Alibek Omarov
parent
69e15e9c7b
commit
5aef09ce5d
@@ -313,25 +313,25 @@ Key_GetKey
|
||||
*/
|
||||
int Key_GetKey( const char *pBinding )
|
||||
{
|
||||
int i;
|
||||
int i, len;
|
||||
const char *p;
|
||||
|
||||
if( !pBinding ) return -1;
|
||||
|
||||
len = Q_strlen( pBinding );
|
||||
|
||||
for( i = 0; i < 256; i++ )
|
||||
{
|
||||
if( !keys[i].binding )
|
||||
continue;
|
||||
|
||||
if( *keys[i].binding == '+' )
|
||||
{
|
||||
if( !Q_strnicmp( keys[i].binding + 1, pBinding, Q_strlen( pBinding )))
|
||||
return i;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !Q_strnicmp( keys[i].binding, pBinding, Q_strlen( pBinding )))
|
||||
return i;
|
||||
}
|
||||
p = keys[i].binding;
|
||||
|
||||
if( *p == '+' )
|
||||
p++;
|
||||
|
||||
if( !Q_strnicmp( p, pBinding, len ) )
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user