diff --git a/CMakeLists.txt b/CMakeLists.txt index a1dd0e20f..1bd53655c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1025,6 +1025,7 @@ set(EXPECTED_DATA editor/entities_clear/blockworlds.png editor/entities_clear/ddnet.png editor/entities_clear/ddrace.png + editor/entities_clear/f-ddrace.png editor/entities_clear/fng.png editor/entities_clear/race.png editor/entities_clear/vanilla.png diff --git a/data/editor/entities_clear/f-ddrace.png b/data/editor/entities_clear/f-ddrace.png new file mode 100644 index 000000000..bee83a136 Binary files /dev/null and b/data/editor/entities_clear/f-ddrace.png differ diff --git a/datasrc/network.py b/datasrc/network.py index 430b8000b..4766f2986 100644 --- a/datasrc/network.py +++ b/datasrc/network.py @@ -21,7 +21,7 @@ GameInfoFlags = [ # Full, use GameInfoFlags2 for more flags ] GameInfoFlags2 = [ - "ALLOW_X_SKINS", "GAMETYPE_CITY", + "ALLOW_X_SKINS", "GAMETYPE_CITY", "GAMETYPE_FDDRACE", "ENTITIES_FDDRACE", ] ExPlayerFlags = ["AFK", "PAUSED", "SPEC"] @@ -56,7 +56,7 @@ enum enum { - GAMEINFO_CURVERSION=5, + GAMEINFO_CURVERSION=6, }; ''' diff --git a/src/game/client/components/mapimages.cpp b/src/game/client/components/mapimages.cpp index 60190d750..f80c6b902 100644 --- a/src/game/client/components/mapimages.cpp +++ b/src/game/client/components/mapimages.cpp @@ -155,7 +155,9 @@ IGraphics::CTextureHandle CMapImages::GetEntities(EMapImageEntityLayerType Entit EMapImageModType EntitiesModType = MAP_IMAGE_MOD_TYPE_DDNET; bool EntitesAreMasked = !GameClient()->m_GameInfo.m_DontMaskEntities; - if(GameClient()->m_GameInfo.m_EntitiesDDNet) + if(GameClient()->m_GameInfo.m_EntitiesFDDrace) + EntitiesModType = MAP_IMAGE_MOD_TYPE_FDDRACE; + else if(GameClient()->m_GameInfo.m_EntitiesDDNet) EntitiesModType = MAP_IMAGE_MOD_TYPE_DDNET; else if(GameClient()->m_GameInfo.m_EntitiesDDRace) EntitiesModType = MAP_IMAGE_MOD_TYPE_DDRACE; diff --git a/src/game/client/components/mapimages.h b/src/game/client/components/mapimages.h index b313b2908..af0b09878 100644 --- a/src/game/client/components/mapimages.h +++ b/src/game/client/components/mapimages.h @@ -24,6 +24,7 @@ enum EMapImageModType MAP_IMAGE_MOD_TYPE_BLOCKWORLDS, MAP_IMAGE_MOD_TYPE_FNG, MAP_IMAGE_MOD_TYPE_VANILLA, + MAP_IMAGE_MOD_TYPE_FDDRACE, MAP_IMAGE_MOD_TYPE_COUNT, }; @@ -34,7 +35,8 @@ static const char *const gs_aModEntitiesNames[] = { "race", "blockworlds", "fng", - "vanilla"}; + "vanilla", + "f-ddrace"}; class CMapImages : public CComponent { diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 8f85ff4a8..7070dcb39 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -1053,6 +1053,7 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize, bool City; bool Vanilla; bool Plus; + bool FDDrace; if(Version < 1) { Race = IsRace(pFallbackServerInfo); @@ -1064,6 +1065,7 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize, City = IsCity(pFallbackServerInfo); Vanilla = IsVanilla(pFallbackServerInfo); Plus = IsPlus(pFallbackServerInfo); + FDDrace = false; } else { @@ -1076,9 +1078,10 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize, Vanilla = Flags & GAMEINFOFLAG_GAMETYPE_VANILLA; Plus = Flags & GAMEINFOFLAG_GAMETYPE_PLUS; City = Version >= 5 && Flags2 & GAMEINFOFLAG2_GAMETYPE_CITY; + FDDrace = Version >= 6 && Flags2 & GAMEINFOFLAG2_GAMETYPE_FDDRACE; // Ensure invariants upheld by the server info parsing business. - DDRace = DDRace || DDNet; + DDRace = DDRace || DDNet || FDDrace; Race = Race || FastCap || DDRace; } @@ -1108,6 +1111,7 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize, Info.m_Race = Race; Info.m_DontMaskEntities = !DDNet; Info.m_AllowXSkins = false; + Info.m_EntitiesFDDrace = FDDrace; if(Version >= 0) { @@ -1149,6 +1153,10 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize, { Info.m_AllowXSkins = Flags2 & GAMEINFOFLAG2_ALLOW_X_SKINS; } + if(Version >= 6) + { + Info.m_EntitiesFDDrace = Flags2 & GAMEINFOFLAG2_ENTITIES_FDDRACE; + } return Info; } diff --git a/src/game/client/gameclient.h b/src/game/client/gameclient.h index 5bae29e46..bcf02fc4e 100644 --- a/src/game/client/gameclient.h +++ b/src/game/client/gameclient.h @@ -49,6 +49,7 @@ public: bool m_EntitiesFNG; bool m_EntitiesVanilla; bool m_EntitiesBW; + bool m_EntitiesFDDrace; bool m_Race;