diff --git a/engine/common/cvar.c b/engine/common/cvar.c index c2b5210ea..7d58c0b7d 100644 --- a/engine/common/cvar.c +++ b/engine/common/cvar.c @@ -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) { diff --git a/engine/common/cvar.h b/engine/common/cvar.h index ca5ee805e..dfdf47d20 100644 --- a/engine/common/cvar.h +++ b/engine/common/cvar.h @@ -69,6 +69,9 @@ typedef struct cvar_s void (*callback) (struct cvar_s *var, char *oldvalue); + + int ival; + char *defaultstr; //default qbyte restriction;