From 9db53bd7a0f953539114f29d24047238c25b409f Mon Sep 17 00:00:00 2001 From: devdenn Date: Sat, 12 Aug 2023 18:07:47 +0200 Subject: [PATCH] Fix smooth zoom with zero causing problems with multiview --- src/game/client/components/camera.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/client/components/camera.cpp b/src/game/client/components/camera.cpp index 80af33cbb66..4635c9e66e4 100644 --- a/src/game/client/components/camera.cpp +++ b/src/game/client/components/camera.cpp @@ -31,7 +31,7 @@ float CCamera::ZoomProgress(float CurrentTime) const void CCamera::ScaleZoom(float Factor) { float CurrentTarget = m_Zooming ? m_ZoomSmoothingTarget : m_Zoom; - ChangeZoom(CurrentTarget * Factor, g_Config.m_ClSmoothZoomTime); + ChangeZoom(CurrentTarget * Factor, m_pClient->m_Snap.m_SpecInfo.m_Active && GameClient()->m_MultiViewActivated ? g_Config.m_ClMultiViewZoomSmoothness : g_Config.m_ClSmoothZoomTime); } float CCamera::MaxZoomLevel() @@ -218,7 +218,7 @@ void CCamera::ConZoom(IConsole::IResult *pResult, void *pUserData) { CCamera *pSelf = (CCamera *)pUserData; float TargetLevel = pResult->NumArguments() ? pResult->GetFloat(0) : g_Config.m_ClDefaultZoom; - pSelf->ChangeZoom(std::pow(ZoomStep, TargetLevel - 10), g_Config.m_ClSmoothZoomTime); + pSelf->ChangeZoom(std::pow(ZoomStep, TargetLevel - 10), pSelf->m_pClient->m_Snap.m_SpecInfo.m_Active && pSelf->GameClient()->m_MultiViewActivated ? g_Config.m_ClMultiViewZoomSmoothness : g_Config.m_ClSmoothZoomTime); if(pSelf->GameClient()->m_MultiViewActivated) pSelf->GameClient()->m_MultiViewPersonalZoom = 0;