]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - view.c
added cl_deathnoviewmodel, cl_deathscoreboard and cl_deathtilt cvars so that games...
[xonotic/darkplaces.git] / view.c
diff --git a/view.c b/view.c
index b1e2a98df4927b83ca338ab9a23c4a23ae427c8b..c02459debcf06065ee4e765db5428684be9c6e4b 100644 (file)
--- a/view.c
+++ b/view.c
@@ -64,6 +64,8 @@ cvar_t chase_active = {CVAR_SAVE, "chase_active", "0"};
 // GAME_GOODVSBAD2
 cvar_t chase_stevie = {0, "chase_stevie", "0"};
 
+cvar_t cl_deathtilt = {0, "cl_deathtilt", "1"};
+
 float  v_dmg_time, v_dmg_roll, v_dmg_pitch;
 
 
@@ -385,10 +387,10 @@ void V_CalcRefdef (void)
                        {
                                // first person view from entity
                                // angles
-                               if (cl.stats[STAT_HEALTH] <= 0 && gamemode != GAME_FNIGGIUM)
+                               if (cl.stats[STAT_HEALTH] <= 0 && cl_deathtilt.integer)
                                        viewangles[ROLL] = 80;  // dead view angle
                                VectorAdd(viewangles, cl.punchangle, viewangles);
-                               viewangles[ROLL] += V_CalcRoll(cl.viewangles, cl.velocity);
+                               viewangles[ROLL] += V_CalcRoll(cl.viewangles, cl.movement_velocity);
                                if (v_dmg_time > 0)
                                {
                                        viewangles[ROLL] += v_dmg_time/v_kicktime.value*v_dmg_roll;
@@ -413,7 +415,7 @@ void V_CalcRefdef (void)
                                                cycle = sin(M_PI + M_PI * (cycle-cl_bobup.value)/(1.0 - cl_bobup.value));
                                        // bob is proportional to velocity in the xy plane
                                        // (don't count Z, or jumping messes it up)
-                                       bob = sqrt(cl.velocity[0]*cl.velocity[0] + cl.velocity[1]*cl.velocity[1]) * cl_bob.value;
+                                       bob = sqrt(cl.movement_velocity[0]*cl.movement_velocity[0] + cl.movement_velocity[1]*cl.movement_velocity[1]) * cl_bob.value;
                                        bob = bob*0.3 + bob*0.7*cycle;
                                        vieworg[2] += bound(-7, bob, 4);
                                }
@@ -596,5 +598,7 @@ void V_Init (void)
        Cvar_RegisterVariable (&chase_active);
        if (gamemode == GAME_GOODVSBAD2)
                Cvar_RegisterVariable (&chase_stevie);
+
+       Cvar_RegisterVariable (&cl_deathtilt.integer);
 }