Merge BW support into IsDDNet

This commit is contained in:
fokkonaut 2019-01-14 16:50:06 +01:00
parent cd3a3f7399
commit cf09fbd1ea
4 changed files with 6 additions and 11 deletions

View file

@ -70,7 +70,6 @@ bool IsRace(const CServerInfo *pInfo);
bool IsFastCap(const CServerInfo *pInfo);
bool IsDDRace(const CServerInfo *pInfo);
bool IsDDNet(const CServerInfo *pInfo);
bool IsBlockWorlds(const CServerInfo *pInfo);
bool Is64Player(const CServerInfo *pInfo);
bool IsPlus(const CServerInfo *pInfo);

View file

@ -56,15 +56,11 @@ bool IsDDNet(const CServerInfo *pInfo)
{
return (str_find_nocase(pInfo->m_aGameType, "ddracenet")
|| str_find_nocase(pInfo->m_aGameType, "ddnet"))
|| (str_comp_nocase_num(pInfo->m_aGameType, "bw ", 4) == 0)
|| (str_comp_nocase(pInfo->m_aGameType, "bw") == 0)
&& !IsBlockInfectionZ(pInfo);
}
bool IsBlockWorlds(const CServerInfo *pInfo)
{
return str_comp_nocase_num(pInfo->m_aGameType, "bw ", 4) == 0
|| str_comp_nocase(pInfo->m_aGameType, "bw") == 0;
}
// other
bool Is64Player(const CServerInfo *pInfo)

View file

@ -27,7 +27,7 @@ void CCamera::OnRender()
CServerInfo Info;
Client()->GetServerInfo(&Info);
if(!(m_pClient->m_Snap.m_SpecInfo.m_Active || IsRace(&Info) || IsBlockWorlds(&Info) || Client()->State() == IClient::STATE_DEMOPLAYBACK))
if(!(m_pClient->m_Snap.m_SpecInfo.m_Active || IsRace(&Info) || Client()->State() == IClient::STATE_DEMOPLAYBACK))
{
m_ZoomSet = false;
m_Zoom = 1.0;
@ -108,7 +108,7 @@ void CCamera::ConZoomPlus(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) || IsBlockWorlds(&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 *= ZoomStep;
}
void CCamera::ConZoomMinus(IConsole::IResult *pResult, void *pUserData)
@ -116,7 +116,7 @@ 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) || IsBlockWorlds(&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)
{
if(((CCamera *)pUserData)->m_Zoom < 500.0f/ZoomStep)
{

View file

@ -141,7 +141,7 @@ void CEmoticon::OnRender()
CServerInfo pServerInfo;
Client()->GetServerInfo(&pServerInfo);
if((IsDDRace(&pServerInfo) || IsDDNet(&pServerInfo) || IsBlockWorlds(&pServerInfo) || IsPlus(&pServerInfo)) && g_Config.m_ClEyeWheel)
if((IsDDRace(&pServerInfo) || IsDDNet(&pServerInfo) || IsPlus(&pServerInfo)) && g_Config.m_ClEyeWheel)
{
Graphics()->TextureSet(-1);
Graphics()->QuadsBegin();