Fix float cvars saving wrong when set to max

This commit is contained in:
fickleheart 2019-12-13 23:05:36 -06:00
parent bc2ed52625
commit 0047dba279

View file

@ -2060,7 +2060,12 @@ void CV_SaveVariables(FILE *f)
// Silly hack for Min/Max vars
if (!strcmp(cvar->string, "MAX") || !strcmp(cvar->string, "MIN"))
sprintf(stringtowrite, "%d", cvar->value);
{
if (cvar->flags & CV_FLOAT)
sprintf(stringtowrite, "%f", FIXED_TO_FLOAT(cvar->value));
else
sprintf(stringtowrite, "%d", cvar->value);
}
else
strcpy(stringtowrite, cvar->string);