mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Do not restart ghost and race recorder when the race timer is turned on with /timer
This commit is contained in:
parent
0891ce2812
commit
66cc527af4
|
@ -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;
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue