Weird cvar zeros fix

This commit is contained in:
Maddes Buecher 2000-08-17 18:28:28 +00:00
parent ac7199d6e2
commit f9bc5b2c22

View file

@ -228,9 +228,18 @@ void Cvar_SetROM (cvar_t *var, char *value)
Cvar_SetValue Cvar_SetValue
============ ============
*/ */
// 1999-09-07 weird cvar zeros fix by Maddes
void Cvar_SetValue (cvar_t *var_name, float value) void Cvar_SetValue (cvar_t *var_name, float value)
{ {
Cvar_Set (var_name, va("%f", value)); char val[32];
int i;
sprintf (val, "%f", value);
for (i=strlen(val)-1 ; i>0 && val[i]=='0' && val[i-1]!='.' ; i--)
{
val[i] = 0;
}
Cvar_Set (var_name, val);
} }
/* /*