Fix crash when pmove_msec is 0

When pmove_fixed is set to 1, setting pmove_msec to 0 would crash.
This commit is contained in:
Zack Middleton 2017-08-19 01:28:49 -05:00
parent bae86208f9
commit e793c0c37c
2 changed files with 4 additions and 0 deletions

View file

@ -489,9 +489,11 @@ void CG_PredictPlayerState( void ) {
if ( pmove_msec.integer < 8 ) { if ( pmove_msec.integer < 8 ) {
trap_Cvar_Set("pmove_msec", "8"); trap_Cvar_Set("pmove_msec", "8");
trap_Cvar_Update(&pmove_msec);
} }
else if (pmove_msec.integer > 33) { else if (pmove_msec.integer > 33) {
trap_Cvar_Set("pmove_msec", "33"); trap_Cvar_Set("pmove_msec", "33");
trap_Cvar_Update(&pmove_msec);
} }
cg_pmove.pmove_fixed = pmove_fixed.integer;// | cg_pmove_fixed.integer; cg_pmove.pmove_fixed = pmove_fixed.integer;// | cg_pmove_fixed.integer;

View file

@ -785,9 +785,11 @@ void ClientThink_real( gentity_t *ent ) {
if ( pmove_msec.integer < 8 ) { if ( pmove_msec.integer < 8 ) {
trap_Cvar_Set("pmove_msec", "8"); trap_Cvar_Set("pmove_msec", "8");
trap_Cvar_Update(&pmove_msec);
} }
else if (pmove_msec.integer > 33) { else if (pmove_msec.integer > 33) {
trap_Cvar_Set("pmove_msec", "33"); trap_Cvar_Set("pmove_msec", "33");
trap_Cvar_Update(&pmove_msec);
} }
if ( pmove_fixed.integer || client->pers.pmoveFixed ) { if ( pmove_fixed.integer || client->pers.pmoveFixed ) {