Merge pull request #7125 from Vy0x2/pr-fix-mv-default-zoom

Remove setting default zoom after leaving multiview, fixes #7113
This commit is contained in:
Dennis Felsing 2023-09-02 20:00:47 +00:00 committed by GitHub
commit 3ff799770c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View file

@ -10,6 +10,7 @@
#include "camera.h"
#include "controls.h"
#include <limits>
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)

View file

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