float stomachsplash_alpha, stomachsplash_remove_at_respawn;\r
float volume_modify_1, volume_modify_2, volume_modify_default_1, volume_modify_default_2;\r
float volume_modify_changed_1, volume_modify_changed_2;\r
+float eventchase_current_distance;\r
vector myhealth_gentlergb;\r
vector liquidcolor_prev;\r
vector damage_blurpostprocess, content_blurpostprocess;\r
pmove_org = warpzone_fixview_origin - vo;\r
input_angles = warpzone_fixview_angles;\r
\r
+ // event chase camera\r
+ if(cvar("chase_active") <= 0) // greater than 0 means it's enabled manually, and this code is skipped\r
+ {\r
+ if(spectatee_status >= 0 && (cvar("cl_eventchase_death") && getstati(STAT_HEALTH) <= 0 && !intermission))\r
+ {\r
+ // We must enable chase_active to get a third person view (weapon viewmodel hidden and own player model showing).\r
+ // Ideally, there should be another way to enable third person cameras, such as through R_SetView()\r
+ if(!cvar("chase_active"))\r
+ cvar_set("chase_active", "-1"); // -1 enables chase_active while marking it as set by this code, and not by the user (which would be 1)\r
+\r
+ // make the camera smooth back\r
+ if(cvar("cl_eventchase_speed") && eventchase_current_distance < cvar("cl_eventchase_distance"))\r
+ eventchase_current_distance += cvar("cl_eventchase_speed") * (cvar("cl_eventchase_distance") - eventchase_current_distance) * frametime; // slow down the further we get\r
+ else if(eventchase_current_distance != cvar("cl_eventchase_distance"))\r
+ eventchase_current_distance = cvar("cl_eventchase_distance");\r
+\r
+ vector eventchase_target_origin;\r
+ makevectors(view_angles);\r
+ // pass 1, used to check where the camera would go and obtain the trace_fraction\r
+ eventchase_target_origin = pmove_org - v_forward * eventchase_current_distance;\r
+\r
+ traceline(pmove_org, eventchase_target_origin, MOVE_WORLDONLY, self);\r
+ // pass 2, also multiplying view_forward with trace_fraction, to prevent the camera from going through walls\r
+ // The 0.1 subtraction is to not limit the camera precisely at the wall surface, as that allows the view to poke through\r
+ eventchase_target_origin = pmove_org - v_forward * eventchase_current_distance * (trace_fraction - 0.1);\r
+\r
+ R_SetView(VF_ORIGIN, eventchase_target_origin);\r
+ }\r
+ else if(cvar("chase_active") < 0) // time to disable chase_active if it was set by this code\r
+ {\r
+ cvar_set("chase_active", "0");\r
+ eventchase_current_distance = 0; // start from 0 next time\r
+ }\r
+ }\r
+\r
// Render the Scene\r
if(!intermission || !view_set)\r
{\r