From b1ed78d58de673ebeb425b296481bedcc2285971 Mon Sep 17 00:00:00 2001 From: Learath Date: Fri, 19 Jul 2019 12:28:08 +0300 Subject: [PATCH] Add new flag, Fix #1807 --- datasrc/network.py | 2 +- src/game/client/components/hud.cpp | 2 +- src/game/client/gameclient.cpp | 8 +++++--- src/game/client/gameclient.h | 1 + src/game/server/gamecontroller.cpp | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/datasrc/network.py b/datasrc/network.py index 9b0e32340..bcf5c8e8c 100644 --- a/datasrc/network.py +++ b/datasrc/network.py @@ -17,7 +17,7 @@ GameInfoFlags = [ "BUG_DDRACE_INPUT", "BUG_FNG_LASER_RANGE", "BUG_VANILLA_BOUNCE", "PREDICT_FNG", "PREDICT_DDRACE", "PREDICT_DDRACE_TILES", "PREDICT_VANILLA", "ENTITIES_DDNET", "ENTITIES_DDRACE", "ENTITIES_RACE", "ENTITIES_FNG", - "ENTITIES_VANILLA", + "ENTITIES_VANILLA", "RACE_SHOW_RECORD", ] Emoticons = ["OOP", "EXCLAMATION", "HEARTS", "DROP", "DOTDOT", "MUSIC", "SORRY", "GHOST", "SUSHI", "SPLATTEE", "DEVILTEE", "ZOMG", "ZZZ", "WTF", "EYES", "QUESTION"] diff --git a/src/game/client/components/hud.cpp b/src/game/client/components/hud.cpp index 46cf37abe..cf05d660d 100644 --- a/src/game/client/components/hud.cpp +++ b/src/game/client/components/hud.cpp @@ -126,7 +126,7 @@ void CHud::RenderGameTimer() str_format(aBuf, sizeof(aBuf), "00:00.0"); else if(Time <= 0) str_format(aBuf, sizeof(aBuf), "00:00"); - else if(GameClient()->m_GameInfo.m_RaceRecordMessage && m_ServerRecord >= 0) + else if(GameClient()->m_GameInfo.m_RaceShowRecord && GameClient()->m_GameInfo.m_RaceRecordMessage && m_ServerRecord >= 0) str_format(aBuf, sizeof(aBuf), "%02d:%02d", (int)(m_ServerRecord*100)/60, ((int)(m_ServerRecord*100)%60)); else if(g_Config.m_ClShowDecisecs) str_format(aBuf, sizeof(aBuf), "%02d:%02d.%d", Time/60, Time%60, m_DDRaceTick/10); diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 1247c75a0..ef52cd939 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -1007,8 +1007,8 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize, Info.m_FlagStartsRace = FastCap; Info.m_TimeScore = Race; Info.m_UnlimitedAmmo = Race; - Info.m_DDRaceRecordMessage = DDRace; - Info.m_RaceRecordMessage = Race && !DDRace; + Info.m_DDRaceRecordMessage = DDRace && !DDNet; + Info.m_RaceRecordMessage = DDNet || (Race && !DDRace); Info.m_AllowEyeWheel = DDRace || BlockWorlds || Plus; Info.m_AllowHookColl = DDRace; Info.m_AllowZoom = Race || BlockWorlds; @@ -1025,7 +1025,8 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize, Info.m_EntitiesRace = Race; Info.m_EntitiesFNG = FNG; Info.m_EntitiesVanilla = Vanilla; - Info.m_Race = Race || DDRace; + Info.m_Race = Race; + Info.m_RaceShowRecord = Race && !DDRace; if(Version >= 0) { @@ -1057,6 +1058,7 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize, if(Version >= 3) { Info.m_Race = Flags&GAMEINFOFLAG_RACE; + Info.m_RaceShowRecord = Flags&GAMEINFOFLAG_RACE_SHOW_RECORD; } return Info; } diff --git a/src/game/client/gameclient.h b/src/game/client/gameclient.h index 2d157bcd6..021180a33 100644 --- a/src/game/client/gameclient.h +++ b/src/game/client/gameclient.h @@ -89,6 +89,7 @@ public: bool m_EntitiesVanilla; bool m_Race; + bool m_RaceShowRecord; }; class CGameClient : public IGameClient diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp index 1527ef694..4f6e849d3 100644 --- a/src/game/server/gamecontroller.cpp +++ b/src/game/server/gamecontroller.cpp @@ -545,7 +545,7 @@ void IGameController::Snap(int SnappingClient) | GAMEINFOFLAG_GAMETYPE_DDRACE | GAMEINFOFLAG_GAMETYPE_DDNET | GAMEINFOFLAG_UNLIMITED_AMMO - | GAMEINFOFLAG_DDRACE_RECORD_MESSAGE + | GAMEINFOFLAG_RACE_RECORD_MESSAGE | GAMEINFOFLAG_ALLOW_EYE_WHEEL | GAMEINFOFLAG_ALLOW_HOOK_COLL | GAMEINFOFLAG_ALLOW_ZOOM