mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-12 19:18:20 +00:00
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:
commit
3ff799770c
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
#include "camera.h"
|
#include "camera.h"
|
||||||
#include "controls.h"
|
#include "controls.h"
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
CCamera::CCamera()
|
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;
|
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);
|
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;
|
pSelf->GameClient()->m_MultiViewPersonalZoom = 0;
|
||||||
}
|
}
|
||||||
void CCamera::ConSetView(IConsole::IResult *pResult, void *pUserData)
|
void CCamera::ConSetView(IConsole::IResult *pResult, void *pUserData)
|
||||||
|
|
|
@ -637,11 +637,6 @@ void CGameClient::UpdatePositions()
|
||||||
|
|
||||||
if(!m_MultiViewActivated && m_MultiView.m_IsInit)
|
if(!m_MultiViewActivated && m_MultiView.m_IsInit)
|
||||||
ResetMultiView();
|
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();
|
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 everyone of a team killed, we have no ids to spectate anymore, so we disable multi view
|
||||||
if(!IsMultiViewIdSet())
|
if(!IsMultiViewIdSet())
|
||||||
m_MultiViewActivated = false;
|
ResetMultiView();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// the "main" tee killed, search a new one
|
// the "main" tee killed, search a new one
|
||||||
|
@ -3582,7 +3577,7 @@ void CGameClient::HandleMultiView()
|
||||||
m_MultiView.m_SecondChance = Client()->LocalTime() + 0.3f;
|
m_MultiView.m_SecondChance = Client()->LocalTime() + 0.3f;
|
||||||
else if(m_MultiView.m_SecondChance < Client()->LocalTime())
|
else if(m_MultiView.m_SecondChance < Client()->LocalTime())
|
||||||
{
|
{
|
||||||
m_MultiViewActivated = false;
|
ResetMultiView();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue