From b95c72eb3fb8db4efeb0c0d47f57bad68ec5c1ed Mon Sep 17 00:00:00 2001 From: Alexander 'z33ky' Hirsch <1zeeky@gmail.com> Date: Thu, 29 Apr 2021 18:06:36 +0200 Subject: [PATCH] Fix viewmodel flip on zoom The fabs() was incorrectly applied only to the viewmodel's FOV instead of the result of that subtracted by the FOV offset. Further it doesn't seem to make sense to use the absolute value of that subtraction; Yes, it does prevent flipping, but it will zoom out again as the FOV decreases. Instead just limit the result of the subtraction to non-negative numbers. --- sp/src/game/client/view.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sp/src/game/client/view.cpp b/sp/src/game/client/view.cpp index 21294735..c78c76fd 100644 --- a/sp/src/game/client/view.cpp +++ b/sp/src/game/client/view.cpp @@ -745,7 +745,7 @@ void CViewRender::SetUpViews() //Adjust the viewmodel's FOV to move with any FOV offsets on the viewer's end #ifdef MAPBASE - view.fovViewmodel = fabs(g_pClientMode->GetViewModelFOV()) - flFOVOffset; + view.fovViewmodel = max(0.001f, g_pClientMode->GetViewModelFOV() - flFOVOffset); #else view.fovViewmodel = g_pClientMode->GetViewModelFOV() - flFOVOffset; #endif