added an ival field to cvars. like value but an int. because its faster to test.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3384 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2009-10-06 00:29:17 +00:00
parent 18ef542c7f
commit 25114afb04
2 changed files with 5 additions and 1 deletions

View file

@ -659,7 +659,7 @@ cvar_t *Cvar_SetCore (cvar_t *var, const char *value, qboolean force)
char *old = Info_ValueForKey(cls.userinfo, var->name);
if (strcmp(old, value)) //only spam the server if it actually changed
{ //this helps with config execs
Info_SetValueForKey (cls.userinfo, var->name, value, MAX_INFO_STRING);
Info_SetValueForKey (cls.userinfo, var->name, value, sizeof(cls.userinfo));
if (cls.state >= ca_connected)
{
#ifdef Q2CLIENT
@ -682,6 +682,7 @@ cvar_t *Cvar_SetCore (cvar_t *var, const char *value, qboolean force)
var->string = (char*)Z_Malloc (Q_strlen(value)+1);
Q_strcpy (var->string, value);
var->value = Q_atof (var->string);
var->ival = Q_atoi (var->string);
if (latch)
{

View file

@ -69,6 +69,9 @@ typedef struct cvar_s
void (*callback) (struct cvar_s *var, char *oldvalue);
int ival;
char *defaultstr; //default
qbyte restriction;