mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-25 05:21:58 +00:00
Weird cvar zeros fix
This commit is contained in:
parent
ac7199d6e2
commit
f9bc5b2c22
1 changed files with 10 additions and 1 deletions
|
@ -228,9 +228,18 @@ void Cvar_SetROM (cvar_t *var, char *value)
|
|||
Cvar_SetValue
|
||||
============
|
||||
*/
|
||||
// 1999-09-07 weird cvar zeros fix by Maddes
|
||||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue