cosmetic fixup to track stuff, r_rockettrail/r_grenadetrail will correctly update on change, r_rockettrail/r_grenadetrail "" will revert to default instead of no trail
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2282 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
f3d3cb1542
commit
f5ce9a375f
2 changed files with 51 additions and 23 deletions
|
@ -591,6 +591,12 @@ void Cam_TrackPlayer(int pnum, char *cmdname, char *plrarg)
|
|||
int slot;
|
||||
player_info_t *s;
|
||||
|
||||
if (pnum >= MAX_SPLITS)
|
||||
{
|
||||
Con_Printf("This command is unavailable in this compilation.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (cls.state <= ca_connected)
|
||||
{
|
||||
Con_Printf("Not connected.\n");
|
||||
|
@ -698,12 +704,6 @@ void Cam_Track2_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (MAX_SPLITS < 2)
|
||||
{
|
||||
Con_Printf("This command is unavailable in this compilation of FTE QuakeWorld.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Cam_TrackPlayer(1, Cmd_Argv(0), Cmd_Argv(1));
|
||||
}
|
||||
|
||||
|
@ -715,12 +715,6 @@ void Cam_Track3_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (MAX_SPLITS < 3)
|
||||
{
|
||||
Con_Printf("This command is unavailable in this compilation of FTE QuakeWorld.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Cam_TrackPlayer(2, Cmd_Argv(0), Cmd_Argv(1));
|
||||
}
|
||||
|
||||
|
@ -732,12 +726,6 @@ void Cam_Track4_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (MAX_SPLITS < 4)
|
||||
{
|
||||
Con_Printf("This command is unavailable in this compilation of FTE QuakeWorld.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Cam_TrackPlayer(3, Cmd_Argv(0), Cmd_Argv(1));
|
||||
}
|
||||
|
||||
|
|
|
@ -123,13 +123,15 @@ extern cvar_t gl_part_flame;
|
|||
|
||||
// callbacks
|
||||
void R_ParticlesDesc_Callback(struct cvar_s *var, char *oldvalue);
|
||||
void R_Rockettrail_Callback(struct cvar_s *var, char *oldvalue);
|
||||
void R_Grenadetrail_Callback(struct cvar_s *var, char *oldvalue);
|
||||
|
||||
cvar_t r_particlesdesc = SCVARFC("r_particlesdesc", "spikeset;tsshaft", CVAR_SEMICHEAT, R_ParticlesDesc_Callback);
|
||||
|
||||
cvar_t r_part_rain_quantity = SCVAR("r_part_rain_quantity", "1");
|
||||
|
||||
cvar_t r_rockettrail = SCVARF("r_rockettrail", "1", CVAR_SEMICHEAT);
|
||||
cvar_t r_grenadetrail = SCVARF("r_grenadetrail", "1", CVAR_SEMICHEAT);
|
||||
cvar_t r_rockettrail = SCVARFC("r_rockettrail", "1", CVAR_SEMICHEAT, R_Rockettrail_Callback);
|
||||
cvar_t r_grenadetrail = SCVARFC("r_grenadetrail", "1", CVAR_SEMICHEAT, R_Grenadetrail_Callback);
|
||||
|
||||
cvar_t r_particle_tracelimit = SCVAR("r_particle_tracelimit", "250");
|
||||
cvar_t r_part_sparks = SCVAR("r_part_sparks", "1");
|
||||
|
@ -1076,6 +1078,12 @@ void P_SelectableTrail(model_t *model, cvar_t *selection, int mdleffect, int mdl
|
|||
switch (select)
|
||||
{
|
||||
case 0: // check for string, otherwise no trail
|
||||
if (selection->string[0] == '0')
|
||||
{
|
||||
model->particletrail = -1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
int effect = P_FindParticleType(selection->string);
|
||||
|
||||
|
@ -1086,9 +1094,7 @@ void P_SelectableTrail(model_t *model, cvar_t *selection, int mdleffect, int mdl
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
model->particletrail = -1;
|
||||
break;
|
||||
// fall through to default (so semicheat will work properly)
|
||||
case 1: // default model effect
|
||||
default:
|
||||
model->particletrail = mdleffect;
|
||||
|
@ -1224,6 +1230,40 @@ void P_DefaultTrail (model_t *model)
|
|||
model->particletrail = -1;
|
||||
}
|
||||
|
||||
void R_Rockettrail_Callback(struct cvar_s *var, char *oldvalue)
|
||||
{
|
||||
int i;
|
||||
model_t *mod;
|
||||
extern model_t mod_known[];
|
||||
extern int mod_numknown;
|
||||
|
||||
if (cls.state == ca_disconnected)
|
||||
return; // don't bother parsing while disconnected
|
||||
|
||||
for (i=0 , mod=mod_known ; i<mod_numknown ; i++, mod++)
|
||||
{
|
||||
if (mod->flags & EF_ROCKET)
|
||||
P_DefaultTrail(mod);
|
||||
}
|
||||
}
|
||||
|
||||
void R_Grenadetrail_Callback(struct cvar_s *var, char *oldvalue)
|
||||
{
|
||||
int i;
|
||||
model_t *mod;
|
||||
extern model_t mod_known[];
|
||||
extern int mod_numknown;
|
||||
|
||||
if (cls.state == ca_disconnected)
|
||||
return; // don't bother parsing while disconnected
|
||||
|
||||
for (i=0 , mod=mod_known ; i<mod_numknown ; i++, mod++)
|
||||
{
|
||||
if (mod->flags & EF_GRENADE)
|
||||
P_DefaultTrail(mod);
|
||||
}
|
||||
}
|
||||
|
||||
#if _DEBUG
|
||||
// R_BeamInfo_f - debug junk
|
||||
void P_BeamInfo_f (void)
|
||||
|
|
Loading…
Reference in a new issue