From cf09fbd1ea7e12c0e323a74a20acef953b74119b Mon Sep 17 00:00:00 2001 From: fokkonaut <35420825+fokkonaut@users.noreply.github.com> Date: Mon, 14 Jan 2019 16:50:06 +0100 Subject: [PATCH] Merge BW support into IsDDNet --- src/engine/serverbrowser.h | 1 - src/engine/shared/serverbrowser.cpp | 8 ++------ src/game/client/components/camera.cpp | 6 +++--- src/game/client/components/emoticon.cpp | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/engine/serverbrowser.h b/src/engine/serverbrowser.h index 1b01812d7..e4080a086 100644 --- a/src/engine/serverbrowser.h +++ b/src/engine/serverbrowser.h @@ -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); diff --git a/src/engine/shared/serverbrowser.cpp b/src/engine/shared/serverbrowser.cpp index 15bca1650..e9833c618 100644 --- a/src/engine/shared/serverbrowser.cpp +++ b/src/engine/shared/serverbrowser.cpp @@ -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) diff --git a/src/game/client/components/camera.cpp b/src/game/client/components/camera.cpp index 8aa789f92..2d87194ee 100644 --- a/src/game/client/components/camera.cpp +++ b/src/game/client/components/camera.cpp @@ -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) { diff --git a/src/game/client/components/emoticon.cpp b/src/game/client/components/emoticon.cpp index d4f46d4d4..9cab1e802 100644 --- a/src/game/client/components/emoticon.cpp +++ b/src/game/client/components/emoticon.cpp @@ -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();