only allow a maximal zoom factor to make sure no bufferoverflow happens

This commit is contained in:
Jupeyy 2017-09-12 20:14:34 +02:00
parent 93138c1fba
commit 6dc4d1e578

View file

@ -116,8 +116,11 @@ void CCamera::ConZoomMinus(IConsole::IResult *pResult, void *pUserData)
CCamera *pSelf = (CCamera *)pUserData;
CServerInfo Info;
pSelf->Client()->GetServerInfo(&Info);
if(pSelf->m_pClient->m_Snap.m_SpecInfo.m_Active || IsRace(&Info) || pSelf->Client()->State() == IClient::STATE_DEMOPLAYBACK)
((CCamera *)pUserData)->m_Zoom *= 1/ZoomStep;
if(pSelf->m_pClient->m_Snap.m_SpecInfo.m_Active || IsRace(&Info) || pSelf->Client()->State() == IClient::STATE_DEMOPLAYBACK){
if(((CCamera *)pUserData)->m_Zoom < 500.0f/ZoomStep) {
((CCamera *)pUserData)->m_Zoom *= 1/ZoomStep;
}
}
}
void CCamera::ConZoomReset(IConsole::IResult *pResult, void *pUserData)
{