From 533d401ea555967414dd7078ce04aeb643820618 Mon Sep 17 00:00:00 2001 From: devdenn Date: Sat, 2 Sep 2023 16:57:24 +0200 Subject: [PATCH] Remove setting default zoom after leaving multiview --- src/game/client/components/camera.cpp | 3 ++- src/game/client/gameclient.cpp | 9 ++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/game/client/components/camera.cpp b/src/game/client/components/camera.cpp index 18275c48d..3937b42b9 100644 --- a/src/game/client/components/camera.cpp +++ b/src/game/client/components/camera.cpp @@ -10,6 +10,7 @@ #include "camera.h" #include "controls.h" + #include CCamera::CCamera() @@ -224,7 +225,7 @@ void CCamera::ConZoom(IConsole::IResult *pResult, void *pUserData) float TargetLevel = pResult->NumArguments() ? pResult->GetFloat(0) : g_Config.m_ClDefaultZoom; pSelf->ChangeZoom(std::pow(CCamera::ZOOM_STEP, 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) + if(pSelf->GameClient()->m_MultiViewActivated && pSelf->m_pClient->m_Snap.m_SpecInfo.m_Active) pSelf->GameClient()->m_MultiViewPersonalZoom = 0; } void CCamera::ConSetView(IConsole::IResult *pResult, void *pUserData) diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index a449c91b0..7bf4acfd8 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -637,11 +637,6 @@ void CGameClient::UpdatePositions() if(!m_MultiViewActivated && m_MultiView.m_IsInit) ResetMultiView(); - else if(!m_Snap.m_SpecInfo.m_Active) - { - m_Camera.SetZoom(std::pow(CCamera::ZOOM_STEP, g_Config.m_ClDefaultZoom - 10), g_Config.m_ClSmoothZoomTime); - m_MultiViewPersonalZoom = 0; - } UpdateRenderedCharacters(); } @@ -907,7 +902,7 @@ void CGameClient::OnMessage(int MsgId, CUnpacker *pUnpacker, int Conn, bool Dumm // if everyone of a team killed, we have no ids to spectate anymore, so we disable multi view if(!IsMultiViewIdSet()) - m_MultiViewActivated = false; + ResetMultiView(); else { // the "main" tee killed, search a new one @@ -3582,7 +3577,7 @@ void CGameClient::HandleMultiView() m_MultiView.m_SecondChance = Client()->LocalTime() + 0.3f; else if(m_MultiView.m_SecondChance < Client()->LocalTime()) { - m_MultiViewActivated = false; + ResetMultiView(); return; } return;