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.
This commit is contained in:
Alexander 'z33ky' Hirsch 2021-04-29 18:06:36 +02:00
parent 8bf258eb75
commit b95c72eb3f

View File

@ -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