1842: [WIP] Fix timer r=heinrich5991 a=Learath2

I'm really unsure about this one.

DEPENDS on #1839 

Co-authored-by: Learath <learath2@gmail.com>
This commit is contained in:
bors[bot] 2019-07-19 22:23:22 +00:00
commit cd8994147c
5 changed files with 9 additions and 6 deletions

View file

@ -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"]

View file

@ -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);

View file

@ -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;
}

View file

@ -89,6 +89,7 @@ public:
bool m_EntitiesVanilla;
bool m_Race;
bool m_RaceShowRecord;
};
class CGameClient : public IGameClient

View file

@ -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