Use %H when converting float cvars to strings to avoid information loss

This commit is contained in:
Randy Heit 2016-04-23 22:08:49 -05:00
parent 3a0d046f7e
commit fc54dd1ff0

View file

@ -281,7 +281,9 @@ const char *FBaseCVar::ToString (UCVarValue value, ECVarType type)
break;
case CVAR_Float:
mysnprintf (cstrbuf, countof(cstrbuf), "%g", value.Float);
IGNORE_FORMAT_PRE
mysnprintf (cstrbuf, countof(cstrbuf), "%H", value.Float);
IGNORE_FORMAT_POST
break;
case CVAR_GUID:
@ -399,7 +401,9 @@ UCVarValue FBaseCVar::FromFloat (float value, ECVarType type)
break;
case CVAR_String:
mysnprintf (cstrbuf, countof(cstrbuf), "%g", value);
IGNORE_FORMAT_PRE
mysnprintf (cstrbuf, countof(cstrbuf), "%H", value);
IGNORE_FORMAT_POST
ret.String = cstrbuf;
break;