From: terencehill Date: Fri, 29 Jun 2018 10:01:07 +0000 (+0200) Subject: Don't allow zooming while spectating a player in free camera mode X-Git-Tag: xonotic-v0.8.5~1971 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e13c0f31772673aea32e79b4c4f0b7d9efe1c2e3;p=xonotic%2Fxonotic-data.pk3dir.git Don't allow zooming while spectating a player in free camera mode --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 4d355fb2a..253829947 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -491,9 +491,8 @@ vector GetCurrentFov(float fov) if(zoomfactor < 1 || zoomfactor > 30) zoomfactor = 2.5; zoomspeed = autocvar_cl_zoomspeed; - if(zoomspeed >= 0) - if(zoomspeed < 0.5 || zoomspeed > 16) - zoomspeed = 3.5; + if (zoomspeed >= 0 && (zoomspeed < 0.5 || zoomspeed > 16)) + zoomspeed = 3.5; zoomdir = button_zoom; @@ -526,7 +525,11 @@ vector GetCurrentFov(float fov) if(zoomdir) { zoomin_effect = 0; } - if(camera_active) + if (spectatee_status > 0 && STAT(CAMERA_SPECTATOR) == 2) + { + current_viewzoom = 1; + } + else if (camera_active) { current_viewzoom = min(1, current_viewzoom + drawframetime); } @@ -570,10 +573,10 @@ vector GetCurrentFov(float fov) if(autocvar_cl_velocityzoom_enabled && autocvar_cl_velocityzoom_type) // _type = 0 disables velocity zoom too { - if(intermission) { curspeed = 0; } + if (intermission || (spectatee_status > 0 && STAT(CAMERA_SPECTATOR) == 2)) + curspeed = 0; else { - makevectors(view_angles); v = pmove_vel; if(csqcplayer)