mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-13 03:28:19 +00:00
only allow a maximal zoom factor to make sure no bufferoverflow happens
This commit is contained in:
parent
93138c1fba
commit
6dc4d1e578
|
@ -116,8 +116,11 @@ void CCamera::ConZoomMinus(IConsole::IResult *pResult, void *pUserData)
|
||||||
CCamera *pSelf = (CCamera *)pUserData;
|
CCamera *pSelf = (CCamera *)pUserData;
|
||||||
CServerInfo Info;
|
CServerInfo Info;
|
||||||
pSelf->Client()->GetServerInfo(&Info);
|
pSelf->Client()->GetServerInfo(&Info);
|
||||||
if(pSelf->m_pClient->m_Snap.m_SpecInfo.m_Active || IsRace(&Info) || pSelf->Client()->State() == IClient::STATE_DEMOPLAYBACK)
|
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(((CCamera *)pUserData)->m_Zoom < 500.0f/ZoomStep) {
|
||||||
|
((CCamera *)pUserData)->m_Zoom *= 1/ZoomStep;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void CCamera::ConZoomReset(IConsole::IResult *pResult, void *pUserData)
|
void CCamera::ConZoomReset(IConsole::IResult *pResult, void *pUserData)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue