Do not restart ghost and race recorder when the race timer is turned on with /timer

This commit is contained in:
Redix 2017-09-28 16:57:39 +02:00
parent 0891ce2812
commit 66cc527af4
2 changed files with 2 additions and 2 deletions

View file

@ -182,7 +182,7 @@ void CGhost::OnRender()
{
static int s_LastRaceTick = -1;
if(ServerControl && s_LastRaceTick != RaceTick)
if(ServerControl && s_LastRaceTick != RaceTick && Client()->GameTick() - RaceTick < Client()->GameTickSpeed())
{
if(m_Recording && s_LastRaceTick != -1)
m_AllowRestart = true;

View file

@ -35,7 +35,7 @@ void CRaceDemo::OnRender()
int RaceTick = -m_pClient->m_Snap.m_pGameInfoObj->m_WarmupTimer;
// start the demo
bool ForceStart = ServerControl && s_LastRaceTick != RaceTick;
bool ForceStart = ServerControl && s_LastRaceTick != RaceTick && Client()->GameTick() - RaceTick < Client()->GameTickSpeed();
bool AllowRestart = (m_AllowRestart || ForceStart) && m_RaceStartTick + 10 * Client()->GameTickSpeed() < Client()->GameTick();
if(m_RaceState == RACE_IDLE || m_RaceState == RACE_PREPARE || (m_RaceState == RACE_STARTED && AllowRestart))
{