A bunch of stuff:

Cvar_Alias_Get now returns void
cl_pred.c is Tonik's client jumping prediction fix
the rest are adding new aliases: s_volume->volume and sv_edgefriction->edgefriction
This commit is contained in:
Dan Olson 2000-05-06 23:03:45 +00:00
parent d5e5b07ac9
commit 86a35efba3
6 changed files with 8 additions and 19 deletions

View file

@ -79,7 +79,7 @@ cvar_t *Cvar_FindAlias (char *alias_name)
return NULL; return NULL;
} }
cvar_t *Cvar_Alias_Get (char *name, cvar_t *cvar) void Cvar_Alias_Get (char *name, cvar_t *cvar)
{ {
cvar_alias_t *alias; cvar_alias_t *alias;
cvar_t *var; cvar_t *var;
@ -87,12 +87,12 @@ cvar_t *Cvar_Alias_Get (char *name, cvar_t *cvar)
if (Cmd_Exists (name)) if (Cmd_Exists (name))
{ {
Con_Printf ("CAlias_Get: %s is a command\n", name); Con_Printf ("CAlias_Get: %s is a command\n", name);
return NULL; return;
} }
if (Cvar_FindVar(name)) if (Cvar_FindVar(name))
{ {
Con_Printf ("CAlias_Get: tried to alias used cvar name %s\n",name); Con_Printf ("CAlias_Get: tried to alias used cvar name %s\n",name);
return NULL; return;
} }
var = Cvar_FindAlias(name); var = Cvar_FindAlias(name);
if (!var) if (!var)
@ -102,9 +102,7 @@ cvar_t *Cvar_Alias_Get (char *name, cvar_t *cvar)
calias_vars = alias; calias_vars = alias;
alias->name = strdup(name); alias->name = strdup(name);
alias->cvar = cvar; alias->cvar = cvar;
return alias->cvar;
} }
return var;
} }
/* /*

View file

@ -81,7 +81,7 @@ typedef struct cvar_alias_s
cvar_t *Cvar_Get (char *name, char *value, int cvarflags, char *description); cvar_t *Cvar_Get (char *name, char *value, int cvarflags, char *description);
cvar_t *Cvar_Alias_Get (char *name, cvar_t *cvar); void Cvar_Alias_Get (char *name, cvar_t *cvar);
void Cvar_Set (cvar_t *var, char *value); void Cvar_Set (cvar_t *var, char *value);
// equivelant to "<name> <variable>" typed at the console // equivelant to "<name> <variable>" typed at the console

View file

@ -192,6 +192,7 @@ void S_Init (void)
// Always create sound cvars, even with -nosound // Always create sound cvars, even with -nosound
nosound = Cvar_Get ("nosound","0",CVAR_NONE,"None"); nosound = Cvar_Get ("nosound","0",CVAR_NONE,"None");
volume = Cvar_Get ("volume","0.7",CVAR_ARCHIVE,"None"); volume = Cvar_Get ("volume","0.7",CVAR_ARCHIVE,"None");
Cvar_Alias_Get ("s_volume", volume);
precache = Cvar_Get ("precache","1",0,"None"); precache = Cvar_Get ("precache","1",0,"None");
loadas8bit = Cvar_Get ("loadas8bit","0",0,"None"); loadas8bit = Cvar_Get ("loadas8bit","0",0,"None");
bgmvolume = Cvar_Get ("bgmvolume","1",CVAR_ARCHIVE,"None"); bgmvolume = Cvar_Get ("bgmvolume","1",CVAR_ARCHIVE,"None");

View file

@ -104,7 +104,7 @@ CL_PredictUsercmd (player_state_t *from, player_state_t *to, usercmd_t *u,
//for (i=0 ; i<3 ; i++) //for (i=0 ; i<3 ; i++)
//pmove.origin[i] = ((int)(pmove.origin[i]*8))*0.125; //pmove.origin[i] = ((int)(pmove.origin[i]*8))*0.125;
to->waterjumptime = pmove.waterjumptime; to->waterjumptime = pmove.waterjumptime;
to->oldbuttons = pmove.cmd.buttons; to->oldbuttons = pmove.oldbuttons;
VectorCopy (pmove.origin, to->origin); VectorCopy (pmove.origin, to->origin);
VectorCopy (pmove.angles, to->viewangles); VectorCopy (pmove.angles, to->viewangles);
VectorCopy (pmove.velocity, to->velocity); VectorCopy (pmove.velocity, to->velocity);

View file

@ -164,28 +164,19 @@ void SV_Init (void)
extern cvar_t *sv_idealpitchscale; extern cvar_t *sv_idealpitchscale;
extern cvar_t *sv_aim; extern cvar_t *sv_aim;
// Cvar_RegisterVariable (&sv_maxvelocity);
sv_maxvelocity = Cvar_Get ("sv_maxvelocity","2000",0,"None"); sv_maxvelocity = Cvar_Get ("sv_maxvelocity","2000",0,"None");
// Cvar_RegisterVariable (&sv_gravity);
sv_gravity = Cvar_Get ("sv_gravity","800", sv_gravity = Cvar_Get ("sv_gravity","800",
CVAR_USERINFO|CVAR_SERVERINFO,"None"); CVAR_USERINFO|CVAR_SERVERINFO,"None");
// Cvar_RegisterVariable (&sv_friction);
sv_friction = Cvar_Get ("sv_friction","4", sv_friction = Cvar_Get ("sv_friction","4",
CVAR_USERINFO|CVAR_SERVERINFO,"None"); CVAR_USERINFO|CVAR_SERVERINFO,"None");
// Cvar_RegisterVariable (&sv_edgefriction); sv_edgefriction = Cvar_Get ("edgefriction","2",0,"None");
sv_edgefriction = Cvar_Get ("sv_edgefriction","2",0,"None"); Cvar_Alias_Get("sv_edgefriction",sv_edgefriction);
// Cvar_RegisterVariable (&sv_stopspeed);
sv_stopspeed = Cvar_Get ("sv_stopspeed","100",0,"None"); sv_stopspeed = Cvar_Get ("sv_stopspeed","100",0,"None");
// Cvar_RegisterVariable (&sv_maxspeed);
sv_maxspeed = Cvar_Get ("sv_maxspeed","320", sv_maxspeed = Cvar_Get ("sv_maxspeed","320",
CVAR_USERINFO|CVAR_SERVERINFO,"None"); CVAR_USERINFO|CVAR_SERVERINFO,"None");
// Cvar_RegisterVariable (&sv_accelerate);
sv_accelerate = Cvar_Get ("sv_accelerate","10",0,"None"); sv_accelerate = Cvar_Get ("sv_accelerate","10",0,"None");
// Cvar_RegisterVariable (&sv_idealpitchscale);
sv_idealpitchscale = Cvar_Get ("sv_idealpitchscale","0.8",0,"None"); sv_idealpitchscale = Cvar_Get ("sv_idealpitchscale","0.8",0,"None");
// Cvar_RegisterVariable (&sv_aim);
sv_aim = Cvar_Get ("sv_aim","0.93",0,"None"); sv_aim = Cvar_Get ("sv_aim","0.93",0,"None");
// Cvar_RegisterVariable (&sv_nostep);
sv_nostep = Cvar_Get ("sv_nostep","0",0,"None"); sv_nostep = Cvar_Get ("sv_nostep","0",0,"None");
for (i=0 ; i<MAX_MODELS ; i++) for (i=0 ; i<MAX_MODELS ; i++)

View file

@ -38,7 +38,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
edict_t *sv_player; edict_t *sv_player;
extern cvar_t *sv_friction; extern cvar_t *sv_friction;
//cvar_t sv_edgefriction = {"edgefriction", "2"};
cvar_t *sv_edgefriction; cvar_t *sv_edgefriction;
extern cvar_t *sv_stopspeed; extern cvar_t *sv_stopspeed;