Skip to content

Commit a616a1c

Browse files
committed
fix ghost recording stopping and restarting constantly because timer keeps jumping
1 parent 6d30f20 commit a616a1c

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

src/game/server/gamecontroller.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,13 @@ void IGameController::Snap(int SnappingClient)
583583
pGameInfoObj->m_GameStateFlags |= GAMESTATEFLAG_SUDDENDEATH;
584584
if(GameServer()->m_World.m_Paused)
585585
pGameInfoObj->m_GameStateFlags |= GAMESTATEFLAG_PAUSED;
586-
pGameInfoObj->m_RoundStartTick = m_RoundStartTick;
587-
if(GameServer()->ko_game)
588-
pGameInfoObj->m_RoundStartTick = Server()->Tick()-m_Timer;
586+
587+
pGameInfoObj->m_TimeLimit = 0;
588+
if(m_Timer >= 0 && GameServer()->ko_game)
589+
pGameInfoObj->m_TimeLimit = std::ceil(g_Config.m_SvKoTimeLimit/60.0);
590+
591+
pGameInfoObj->m_RoundStartTick = m_RoundStartTick + (g_Config.m_SvKoTimeLimit - pGameInfoObj->m_TimeLimit*60)*50;
592+
589593
pGameInfoObj->m_WarmupTimer = m_Warmup;
590594

591595
pGameInfoObj->m_RoundNum = 0;

src/game/server/gamemodes/DDRace.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ void CGameControllerDDRace::KO_Start()
6060
return;
6161
}
6262

63+
m_RoundStartTick = Server()->Tick();
64+
6365
GameServer()->ko_round++;
6466

6567
GameServer()->ko_player_count = 0;
@@ -99,7 +101,7 @@ void CGameControllerDDRace::KO_Start()
99101

100102
Teams().OnCharacterStart(i);
101103
pChar->m_StartTime = Server()->Tick();
102-
pChar->m_DDRaceState = DDRACE_STARTED;
104+
// pChar->m_DDRaceState = DDRACE_STARTED;
103105

104106
pChar->m_LastTimeCp = -1;
105107
pChar->m_LastTimeCpBroadcasted = -1;

0 commit comments

Comments
 (0)