mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2024-11-10 06:31:48 +00:00
enforcing the [-127 127] usercmd range in trap_GetUserCmd
This commit is contained in:
parent
49f7f8bbd8
commit
b8e4413d2f
2 changed files with 8 additions and 1 deletions
|
@ -311,7 +311,11 @@ int trap_GetCurrentCmdNumber( void ) {
|
|||
}
|
||||
|
||||
qboolean trap_GetUserCmd( int cmdNumber, usercmd_t *ucmd ) {
|
||||
return syscall( CG_GETUSERCMD, cmdNumber, ucmd );
|
||||
const qboolean result = syscall( CG_GETUSERCMD, cmdNumber, ucmd );
|
||||
ucmd->forwardmove = max( ucmd->forwardmove, -127 );
|
||||
ucmd->rightmove = max( ucmd->rightmove, -127 );
|
||||
ucmd->upmove = max( ucmd->upmove, -127 );
|
||||
return result;
|
||||
}
|
||||
|
||||
void trap_SetUserCmdValue( int stateValue, float sensitivityScale ) {
|
||||
|
|
|
@ -212,6 +212,9 @@ void trap_BotFreeClient( int clientNum ) {
|
|||
|
||||
void trap_GetUsercmd( int clientNum, usercmd_t *cmd ) {
|
||||
syscall( G_GET_USERCMD, clientNum, cmd );
|
||||
cmd->forwardmove = max( cmd->forwardmove, -127 );
|
||||
cmd->rightmove = max( cmd->rightmove, -127 );
|
||||
cmd->upmove = max( cmd->upmove, -127 );
|
||||
}
|
||||
|
||||
qboolean trap_GetEntityToken( char *buffer, int bufferSize ) {
|
||||
|
|
Loading…
Reference in a new issue