From fd657795713473b83b459f342e83e1d9f8f76ebc Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 2 Jun 2020 10:29:18 +0200 Subject: [PATCH] If cl_lockview is enabled disable crosshair, spawn zoom effect and velocity zoom effect --- qcsrc/client/main.qc | 7 +++++-- qcsrc/client/view.qc | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index e4661468d..a049b98f2 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -754,8 +754,11 @@ NET_HANDLE(ENT_CLIENT_SPAWNEVENT, bool is_new) // local spawn actions if(is_new && (!entnum || (entnum == player_localentnum))) { - zoomin_effect = 1; - current_viewzoom = (1 / bound(1, autocvar_cl_spawnzoom_factor, 16)); + if(autocvar_cl_spawnzoom && !autocvar_cl_lockview) + { + zoomin_effect = 1; + current_viewzoom = (1 / bound(1, autocvar_cl_spawnzoom_factor, 16)); + } if(autocvar_cl_unpress_zoom_on_spawn) { diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 7a8b5e705..9a753f5ff 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -486,7 +486,7 @@ vector GetCurrentFov(float fov) else setsensitivityscale(1); - if(autocvar_cl_velocityzoom_enabled && autocvar_cl_velocityzoom_type) // _type = 0 disables velocity zoom too + if(autocvar_cl_velocityzoom_enabled && autocvar_cl_velocityzoom_type && !autocvar_cl_lockview) // _type = 0 disables velocity zoom too { if (intermission || (spectatee_status > 0 && STAT(CAMERA_SPECTATOR) == 2)) curspeed = 0; @@ -1085,9 +1085,9 @@ void HUD_Crosshair(entity this) float f, i, j; vector v; - if(!scoreboard_active && !camera_active && intermission != 2 && !STAT(GAME_STOPPED) && - spectatee_status != -1 && (!csqcplayer.viewloc || (!spectatee_status && (csqcplayer.viewloc.spawnflags & VIEWLOC_FREEAIM))) && !MUTATOR_CALLHOOK(DrawCrosshair) && - !HUD_MinigameMenu_IsOpened() ) + if(!scoreboard_active && !camera_active && intermission != 2 && !STAT(GAME_STOPPED) && !autocvar_cl_lockview + && spectatee_status != -1 && (!csqcplayer.viewloc || (!spectatee_status && (csqcplayer.viewloc.spawnflags & VIEWLOC_FREEAIM))) && !MUTATOR_CALLHOOK(DrawCrosshair) + && !HUD_MinigameMenu_IsOpened()) { if (!autocvar_crosshair_enabled) // main toggle for crosshair rendering return; -- 2.39.2