[cvar] Ensure floats can round-trip when setting

The way Cvar_SetValue is used, floats need to be able to round-trip
reliably and thus need up to 9 digits of precision.
This commit is contained in:
Bill Currie 2022-03-18 11:42:14 +09:00
parent c8c742b240
commit a4479f4840

View file

@ -307,7 +307,7 @@ Cvar_Set (cvar_t *var, const char *value)
VISIBLE void
Cvar_SetValue (cvar_t *var, float value)
{
Cvar_Set (var, va (0, "%g", value));
Cvar_Set (var, va (0, "%.9g", value));
}
/*