Skip to content

Commit

Permalink
Fix smooth zoom with zero causing problems with multiview
Browse files Browse the repository at this point in the history
  • Loading branch information
Vy0x2 committed Aug 12, 2023
1 parent 9eb73c9 commit 9db53bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/game/client/components/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9db53bd

Please sign in to comment.