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 135619af8b
commit f0ee901160

View file

@ -836,7 +836,10 @@ static void COM_Add_f(void)
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)));
}
// =========================================================================