v_deathtilt 0 // needed for spectators (who are dead to avoid prediction)
// these settings determine how much the view is affected by movement/damage
-cl_deathfade 1 // fade screen to dark red when dead, value represents how fast the fade is (higher is faster)
+cl_deathfade 0.03 // fade screen to dark red when dead, value represents how fast the fade is (higher is faster)
cl_bobcycle 0 // how long the cycle of up/down view movement takes (only works if cl_bob is not 0), default is 0.6
cl_bob 0.01 // how much view moves up/down when moving (does not move if cl_bobcycle is 0, but still enables cl_bobmodel), default is 0.02
cl_bob2cycle 0 // how long the cycle of left/right view movement takes (only works if cl_bob2 is not 0), default is 0.6
seta cl_hitsound 1 "play a hit notifier sound when you have hit an enemy"
set cl_hitsound_antispam_time 0.05 "don't play the hitsound more often than this"
+seta cl_chase_death 1 "camera goes into 3rd person mode when dead"
+seta cl_chase_intermission 1 "camera goes into 3rd person mode at match end"
+seta cl_chase_distance 100 "final distance of the chase camera"
+seta cl_chase_speed 1.5 "how fast the chase camera slides back, 0 is instant"
+
//nifreks lockonrestart feature, used in team-based game modes, if set to 1 and all players readied up no other player can then join the game anymore, useful to block spectators from joining
set teamplay_lockonrestart 0 "it set to 1 in a team-based game, the teams are locked once all players readied up and the game restarted (no new players can join after restart unless using the server-command unlockteams)"
float contentavgalpha, liquidalpha_prev;
vector liquidcolor_prev;
+float chase_current_distance;
+
void CSQC_UpdateView(float w, float h)
{
entity e;
input_angles = warpzone_fixview_cl_viewangles;
view_angles = warpzone_fixview_angles;
+ // event chase cam
+ if(spectatee_status >= 0 && (autocvar_cl_chase_death || autocvar_cl_chase_intermission))
+ if(autocvar_chase_active <= 0) // greater than 0 means it's enabled manually
+ {
+ if((autocvar_cl_chase_death && getstati(STAT_HEALTH) <= 0 && !intermission) || (autocvar_cl_chase_intermission && intermission) && intermission <= 1) // not during the map voting screen
+ {
+ if(!autocvar_chase_active)
+ cvar_set("chase_active", "-1"); // -1 enables chase_active as well as marking it as set by this code, and not by the user (which would be 1)
+
+ // make the camera smooth back
+ if(autocvar_cl_chase_speed && chase_current_distance < autocvar_cl_chase_distance)
+ chase_current_distance += autocvar_cl_chase_speed * (autocvar_cl_chase_distance - chase_current_distance) * frametime; // slow down smoothly
+ else if(chase_current_distance != autocvar_cl_chase_distance)
+ chase_current_distance = autocvar_cl_chase_distance;
+
+ vector target_origin;
+ target_origin = pmove_org - view_forward * chase_current_distance;
+
+ // don't allow the camera to go through walls
+ traceline(pmove_org, target_origin, MOVE_NORMAL, self);
+ if(trace_fraction == 1)
+ {
+ makevectors(view_angles);
+ R_SetView(VF_ORIGIN, target_origin);
+ }
+ }
+ else if(autocvar_chase_active < 0)
+ {
+ cvar_set("chase_active", "0");
+ chase_current_distance = 0; // start from 0
+ }
+ }
+
if(autocvar_cl_lockview || (autocvar__hud_configure && spectatee_status <= 0))
{
pmove_org = freeze_pmove_org;
float autocvar_crosshair_color_by_health;
float autocvar_cl_hitsound;
float autocvar_cl_hitsound_antispam_time;
+float autocvar_cl_chase_death;
+float autocvar_cl_chase_intermission;
+float autocvar_cl_chase_distance;
+float autocvar_cl_chase_speed;