Skip to content

Commit

Permalink
Fixed cvar integers getting set incorrectly. (Introduced in c722d26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daggolin authored and ouned committed Mar 26, 2017
1 parent d07e384 commit dd3f54f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/qcommon/cvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,9 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, int flags, qboole
var->value = atof (var->string);
var->integer = atoi(var->string);
#else
var->value = strtof(var->string, NULL);
var->integer = var->value;
double strValue = strtod(var->string, NULL);
var->value = strValue;
var->integer = strValue;
#endif
var->resetString = CopyString( var_value );

Expand Down Expand Up @@ -442,8 +443,9 @@ cvar_t *Cvar_Set2( const char *var_name, const char *value, qboolean force, qboo
var->value = atof (var->string);
var->integer = atoi (var->string);
#else
var->value = strtof(var->string, NULL);
var->integer = var->value;
double strValue = strtod(var->string, NULL);
var->value = strValue;
var->integer = strValue;
#endif

return var;
Expand Down

0 comments on commit dd3f54f

Please sign in to comment.