cvar_t chase_stevie = {0, "chase_stevie", "0", "chase cam view from above (used only by GoodVsBad2)"};
cvar_t v_deathtilt = {0, "v_deathtilt", "1", "whether to use sideways view when dead"};
+cvar_t v_deathtiltangle = {0, "v_deathtiltangle", "80", "what roll angle to use when tilting the view while dead"};
float v_dmg_time, v_dmg_roll, v_dmg_pitch;
}
// calculate view angle kicks
- if (cl_entities[cl.viewentity].state_current.active)
+ if (cl.entities[cl.viewentity].state_current.active)
{
- ent = &cl_entities[cl.viewentity];
+ ent = &cl.entities[cl.viewentity];
Matrix4x4_Transform(&ent->render.inversematrix, from, localfrom);
VectorNormalize(localfrom);
v_dmg_pitch = count * localfrom[0] * v_kickpitch.value;
*/
static void V_cshift_f (void)
{
- v_cshift.destcolor[0] = atoi(Cmd_Argv(1));
- v_cshift.destcolor[1] = atoi(Cmd_Argv(2));
- v_cshift.destcolor[2] = atoi(Cmd_Argv(3));
- v_cshift.percent = atoi(Cmd_Argv(4));
+ v_cshift.destcolor[0] = atof(Cmd_Argv(1));
+ v_cshift.destcolor[1] = atof(Cmd_Argv(2));
+ v_cshift.destcolor[2] = atof(Cmd_Argv(3));
+ v_cshift.percent = atof(Cmd_Argv(4));
}
if (cls.state == ca_connected && cls.signon == SIGNONS)
{
// ent is the view entity (visible when out of body)
- ent = &cl_entities[cl.viewentity];
+ ent = &cl.entities[cl.viewentity];
if (cl.intermission)
{
// entity is a fixed camera, just copy the matrix
chase_dest[0] = vieworg[0] + forward[0] * dist;
chase_dest[1] = vieworg[1] + forward[1] * dist;
chase_dest[2] = vieworg[2] + forward[2] * dist + camup;
- trace = CL_TraceBox(vieworg, vec3_origin, vec3_origin, chase_dest, true, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_SKY, false);
+ trace = CL_TraceBox(vieworg, vec3_origin, vec3_origin, chase_dest, true, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_SKY, false);
VectorMAMAM(1, trace.endpos, 8, forward, 4, trace.plane.normal, vieworg);
}
else
// first person view from entity
// angles
if (cl.stats[STAT_HEALTH] <= 0 && v_deathtilt.integer)
- viewangles[ROLL] = 80; // dead view angle
+ viewangles[ROLL] = v_deathtiltangle.value;
VectorAdd(viewangles, cl.punchangle, viewangles);
viewangles[ROLL] += V_CalcRoll(cl.viewangles, cl.movement_velocity);
if (v_dmg_time > 0)
{
double xyspeed, bob;
- xyspeed = sqrt(cl.velocity[0]*cl.velocity[0] + cl.velocity[1]*cl.velocity[1]);
+ xyspeed = sqrt(cl.movement_velocity[0]*cl.movement_velocity[0] + cl.movement_velocity[1]*cl.movement_velocity[1]);
if (cl_bob.value && cl_bobcycle.value)
{
float cycle;
cl.cshifts[CSHIFT_CONTENTS].destcolor[1] = 80;
cl.cshifts[CSHIFT_CONTENTS].destcolor[2] = 50;
}
- cl.cshifts[CSHIFT_CONTENTS].percent = 150 >> 1;
+ cl.cshifts[CSHIFT_CONTENTS].percent = 150 * 0.5;
}
else
{
Cvar_RegisterVariable (&chase_stevie);
Cvar_RegisterVariable (&v_deathtilt);
+ Cvar_RegisterVariable (&v_deathtiltangle);
}