From: Samual Lenks Date: Tue, 13 Aug 2013 20:11:22 +0000 (-0400) Subject: Don't let eventchase put the view into the ceiling when you die X-Git-Tag: xonotic-v0.8.0~368 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e64a2a1d922f7bb65999b71d1c35fd9e42def55d;p=xonotic%2Fxonotic-data.pk3dir.git Don't let eventchase put the view into the ceiling when you die --- diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 13e41a416..5d5f28789 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -483,7 +483,16 @@ void CSQC_UpdateView(float w, float h) if(spectatee_status >= 0 && (autocvar_cl_eventchase_death && is_dead) || intermission) { // 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.) - vector current_view_origin = ((csqcplayer ? csqcplayer.origin : pmove_org) + autocvar_cl_eventchase_viewoffset); + vector current_view_origin = (csqcplayer ? csqcplayer.origin : pmove_org); + + // detect maximum viewoffset and use it + WarpZone_TraceLine(current_view_origin, current_view_origin + autocvar_cl_eventchase_viewoffset + ('0 0 1' * autocvar_cl_eventchase_maxs_z), MOVE_WORLDONLY, self); + current_view_origin_z += + max(0, + (trace_fraction * autocvar_cl_eventchase_viewoffset_z) + - + autocvar_cl_eventchase_maxs_z + ); // We must enable chase_active to get a third person view (weapon viewmodel hidden and own player model showing). // Ideally, there should be another way to enable third person cameras, such as through setproperty()