Support adding to CV_FLOAT cvars with the Add command

This commit is contained in:
James R 2019-07-04 17:48:17 -07:00
parent e276faf819
commit 14be24dfb6

View file

@ -902,7 +902,10 @@ static void COM_Add_f(void)
return; return;
} }
CV_AddValue(cvar, atoi(COM_Argv(2))); if (( cvar->flags & CV_FLOAT ))
CV_Set(cvar, va("%f", FIXED_TO_FLOAT (cvar->value) + atof(COM_Argv(2))));
else
CV_AddValue(cvar, atoi(COM_Argv(2)));
} }
// ========================================================================= // =========================================================================