Allow zooming on city mod

This commit is contained in:
def 2020-09-24 12:01:12 +02:00
parent 9f9ccaccf7
commit 00b66362c3
4 changed files with 14 additions and 5 deletions

View file

@ -21,7 +21,7 @@ GameInfoFlags = [
# Full, use GameInfoFlags2 for more flags # Full, use GameInfoFlags2 for more flags
] ]
GameInfoFlags2 = [ GameInfoFlags2 = [
"ALLOW_X_SKINS", "ALLOW_X_SKINS", "GAMETYPE_CITY",
] ]
ExPlayerFlags = ["AFK", "PAUSED", "SPEC"] ExPlayerFlags = ["AFK", "PAUSED", "SPEC"]

View file

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

View file

@ -48,8 +48,8 @@ bool IsDDRace(const CServerInfo *pInfo)
bool IsBlockInfectionZ(const CServerInfo *pInfo) bool IsBlockInfectionZ(const CServerInfo *pInfo)
{ {
return str_find_nocase(pInfo->m_aGameType, "blockZ") return str_find_nocase(pInfo->m_aGameType, "blockz")
|| str_find_nocase(pInfo->m_aGameType, "infectionZ"); || str_find_nocase(pInfo->m_aGameType, "infectionz");
} }
bool IsBlockWorlds(const CServerInfo *pInfo) bool IsBlockWorlds(const CServerInfo *pInfo)
@ -58,6 +58,11 @@ bool IsBlockWorlds(const CServerInfo *pInfo)
|| (str_comp_nocase(pInfo->m_aGameType, "bw") == 0); || (str_comp_nocase(pInfo->m_aGameType, "bw") == 0);
} }
bool IsCity(const CServerInfo *pInfo)
{
return str_find_nocase(pInfo->m_aGameType, "city");
}
bool IsDDNet(const CServerInfo *pInfo) bool IsDDNet(const CServerInfo *pInfo)
{ {
return str_find_nocase(pInfo->m_aGameType, "ddracenet") return str_find_nocase(pInfo->m_aGameType, "ddracenet")

View file

@ -1020,6 +1020,7 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize,
bool DDRace; bool DDRace;
bool DDNet; bool DDNet;
bool BlockWorlds; bool BlockWorlds;
bool City;
bool Vanilla; bool Vanilla;
bool Plus; bool Plus;
bool AllowXSkins = Flags2 & GAMEINFOFLAG2_ALLOW_X_SKINS; bool AllowXSkins = Flags2 & GAMEINFOFLAG2_ALLOW_X_SKINS;
@ -1031,6 +1032,7 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize,
DDRace = IsDDRace(pFallbackServerInfo); DDRace = IsDDRace(pFallbackServerInfo);
DDNet = IsDDNet(pFallbackServerInfo); DDNet = IsDDNet(pFallbackServerInfo);
BlockWorlds = IsBlockWorlds(pFallbackServerInfo); BlockWorlds = IsBlockWorlds(pFallbackServerInfo);
City = IsCity(pFallbackServerInfo);
Vanilla = IsVanilla(pFallbackServerInfo); Vanilla = IsVanilla(pFallbackServerInfo);
Plus = IsPlus(pFallbackServerInfo); Plus = IsPlus(pFallbackServerInfo);
} }
@ -1044,6 +1046,7 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize,
BlockWorlds = Flags&GAMEINFOFLAG_GAMETYPE_BLOCK_WORLDS; BlockWorlds = Flags&GAMEINFOFLAG_GAMETYPE_BLOCK_WORLDS;
Vanilla = Flags&GAMEINFOFLAG_GAMETYPE_VANILLA; Vanilla = Flags&GAMEINFOFLAG_GAMETYPE_VANILLA;
Plus = Flags&GAMEINFOFLAG_GAMETYPE_PLUS; Plus = Flags&GAMEINFOFLAG_GAMETYPE_PLUS;
City = Flags2&GAMEINFOFLAG2_GAMETYPE_CITY;
// Ensure invariants upheld by the server info parsing business. // Ensure invariants upheld by the server info parsing business.
DDRace = DDRace || DDNet; DDRace = DDRace || DDNet;
@ -1056,9 +1059,9 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize,
Info.m_UnlimitedAmmo = Race; Info.m_UnlimitedAmmo = Race;
Info.m_DDRaceRecordMessage = DDRace && !DDNet; Info.m_DDRaceRecordMessage = DDRace && !DDNet;
Info.m_RaceRecordMessage = DDNet || (Race && !DDRace); Info.m_RaceRecordMessage = DDNet || (Race && !DDRace);
Info.m_AllowEyeWheel = DDRace || BlockWorlds || Plus; Info.m_AllowEyeWheel = DDRace || BlockWorlds || City || Plus;
Info.m_AllowHookColl = DDRace; Info.m_AllowHookColl = DDRace;
Info.m_AllowZoom = Race || BlockWorlds; Info.m_AllowZoom = Race || BlockWorlds || City;
Info.m_BugDDRaceGhost = DDRace; Info.m_BugDDRaceGhost = DDRace;
Info.m_BugDDRaceInput = DDRace; Info.m_BugDDRaceInput = DDRace;
Info.m_BugFNGLaserRange = FNG; Info.m_BugFNGLaserRange = FNG;