void CSQC_Demo_Camera();\r
float Sbar_WouldDrawScoreboard ();\r
float last_health, last_spectatee;\r
-float view_set;\r
float camera_mode;\r
float reticle_type;\r
float chase_active_old;\r
float stomachsplash_alpha;\r
float eventchase_current_distance;\r
float helper_pause, helper_health, helper_armor, helper_ammo, helper_speed, helper_stomachload;\r
+vector freeze_org, freeze_ang;\r
vector myhealth_gentlergb;\r
vector liquidcolor_prev;\r
vector damage_blurpostprocess, content_blurpostprocess;\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(!getstati(STAT_VORE_EATEN) && spectatee_status >= 0 && (cvar("cl_eventchase_death") && getstati(STAT_HEALTH) <= 0 && !intermission))\r
+ if(spectatee_status >= 0 && (cvar("cl_eventchase_death") && getstati(STAT_HEALTH) <= 0 && !intermission) || intermission)\r
{\r
+ // make special vector since we can't use view_origin (It is one frame old as of this code, it gets set later with the results this code makes.)\r
+ vector current_view_origin = getpropertyvec(VF_ORIGIN);\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
+ // Ideally, there should be another way to enable third person cameras, such as through setproperty()\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
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
+ eventchase_target_origin = current_view_origin - v_forward * eventchase_current_distance;\r
+ WarpZone_TraceLine(current_view_origin, 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
+ eventchase_target_origin = current_view_origin - v_forward * eventchase_current_distance * (trace_fraction - 0.1);\r
+ WarpZone_TraceLine(current_view_origin, eventchase_target_origin, MOVE_WORLDONLY, self);\r
\r
- R_SetView(VF_ORIGIN, eventchase_target_origin);\r
- R_SetView(VF_ANGLES, view_angles);\r
+ setproperty(VF_ORIGIN, trace_endpos);\r
+ setproperty(VF_ANGLES, WarpZone_TransformVAngles(WarpZone_trace_transform, view_angles));\r
}\r
else if(cvar("chase_active") < 0) // time to disable chase_active if it was set by this code\r
{\r
cvar_set("v_idlescale", ftos(apply_idlescale));\r
}\r
\r
- // Render the Scene\r
- if(!intermission || !view_set)\r
+ // do lockview after event chase camera so that it still applies whenever necessary.\r
+ if(intermission > 1)\r
+ {\r
+ setproperty(VF_ORIGIN, freeze_org);\r
+ setproperty(VF_ANGLES, freeze_ang);\r
+ }\r
+ else\r
{\r
- view_origin = pmove_org + vo;\r
- view_angles = input_angles;\r
- makevectors(view_angles);\r
- view_forward = v_forward;\r
- view_right = v_right;\r
- view_up = v_up;\r
- view_set = 1;\r
+ freeze_org = getpropertyvec(VF_ORIGIN);\r
+ freeze_ang = getpropertyvec(VF_ANGLES);\r
}\r
\r
+ // Render the Scene\r
+ view_origin = getpropertyvec(VF_ORIGIN);\r
+ view_angles = getpropertyvec(VF_ANGLES);\r
+ makevectors(view_angles);\r
+ view_forward = v_forward;\r
+ view_right = v_right;\r
+ view_up = v_up;\r
+\r
vid_width = w;\r
vid_height = h;\r
\r
// ALWAYS Clear Current Scene First\r
R_ClearScene();\r
\r
+ if(checkextension("DP_CSQC_ROTATEMOVES"))\r
+ {\r
+ setproperty(VF_ORIGIN, view_origin);\r
+ setproperty(VF_ANGLES, view_angles);\r
+ }\r
+\r
// Assign Standard Viewflags\r
// Draw the World (and sky)\r
R_SetView(VF_DRAWWORLD, 1);\r