Add constants for minimum and maximum tick values

This commit is contained in:
Robert Müller 2023-01-03 13:07:03 +01:00
parent 29bf49ae31
commit 25e01eb762
2 changed files with 6 additions and 4 deletions

View file

@ -314,7 +314,7 @@ CServer::CServer()
m_pGameServer = 0;
m_CurrentGameTick = 0;
m_CurrentGameTick = MIN_TICK;
m_RunServer = UNINITIALIZED;
m_aShutdownReason[0] = 0;
@ -541,7 +541,7 @@ int CServer::Init()
Client.m_Sixup = false;
}
m_CurrentGameTick = 0;
m_CurrentGameTick = MIN_TICK;
m_AnnouncementLastLine = 0;
mem_zero(m_aPrevStates, sizeof(m_aPrevStates));
@ -2640,7 +2640,7 @@ int CServer::Run()
int NewTicks = 0;
// load new map
if(m_MapReload || m_CurrentGameTick >= 0x6FFFFFFF) // force reload to make sure the ticks stay within a valid range
if(m_MapReload || m_CurrentGameTick >= MAX_TICK) // force reload to make sure the ticks stay within a valid range
{
// load map
if(LoadMap(Config()->m_SvMap))
@ -2671,7 +2671,7 @@ int CServer::Run()
}
m_GameStartTime = time_get();
m_CurrentGameTick = 0;
m_CurrentGameTick = MIN_TICK;
m_ServerInfoFirstRequest = 0;
Kernel()->ReregisterInterface(GameServer());
GameServer()->OnInit();

View file

@ -87,6 +87,8 @@ enum
MAX_CLIENTS = 64,
VANILLA_MAX_CLIENTS = 16,
MAX_CHECKPOINTS = 25,
MIN_TICK = 0,
MAX_TICK = 0x6FFFFFFF,
MAX_INPUT_SIZE = 128,
MAX_SNAPSHOT_PACKSIZE = 900,