Skip to content

Commit dd3f54f

Browse files
Daggolinouned
authored andcommitted
Fixed cvar integers getting set incorrectly. (Introduced in c722d26)
1 parent d07e384 commit dd3f54f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/qcommon/cvar.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,9 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, int flags, qboole
289289
var->value = atof (var->string);
290290
var->integer = atoi(var->string);
291291
#else
292-
var->value = strtof(var->string, NULL);
293-
var->integer = var->value;
292+
double strValue = strtod(var->string, NULL);
293+
var->value = strValue;
294+
var->integer = strValue;
294295
#endif
295296
var->resetString = CopyString( var_value );
296297

@@ -442,8 +443,9 @@ cvar_t *Cvar_Set2( const char *var_name, const char *value, qboolean force, qboo
442443
var->value = atof (var->string);
443444
var->integer = atoi (var->string);
444445
#else
445-
var->value = strtof(var->string, NULL);
446-
var->integer = var->value;
446+
double strValue = strtod(var->string, NULL);
447+
var->value = strValue;
448+
var->integer = strValue;
447449
#endif
448450

449451
return var;

0 commit comments

Comments
 (0)