Replaced magic number with MAX_CHECKPOINTS

This commit is contained in:
Chairn 2022-07-02 02:13:59 +02:00
parent a69dc599a9
commit b8840c4571
5 changed files with 6 additions and 5 deletions

View file

@ -85,6 +85,7 @@ enum
SERVERINFO_MAX_CLIENTS = 128,
MAX_CLIENTS = 64,
VANILLA_MAX_CLIENTS = 16,
MAX_CHECKPOINTS = 25,
MAX_INPUT_SIZE = 128,
MAX_SNAPSHOT_PACKSIZE = 900,

View file

@ -208,7 +208,7 @@ public:
int m_TimeCpBroadcastEndTick;
int m_LastTimeCp;
int m_LastTimeCpBroadcasted;
float m_aCurrentTimeCp[25];
float m_aCurrentTimeCp[MAX_CHECKPOINTS];
int m_TileIndex;
int m_TileFIndex;

View file

@ -65,7 +65,7 @@ void CSaveTee::Save(CCharacter *pChr)
m_LastTimeCp = pChr->m_LastTimeCp;
m_LastTimeCpBroadcasted = pChr->m_LastTimeCpBroadcasted;
for(int i = 0; i < 25; i++)
for(int i = 0; i < MAX_CHECKPOINTS; i++)
m_aCurrentTimeCp[i] = pChr->m_aCurrentTimeCp[i];
m_NotEligibleForFinish = pChr->m_pPlayer->m_NotEligibleForFinish;
@ -158,7 +158,7 @@ void CSaveTee::Load(CCharacter *pChr, int Team, bool IsSwap)
pChr->m_LastTimeCp = m_LastTimeCp;
pChr->m_LastTimeCpBroadcasted = m_LastTimeCpBroadcasted;
for(int i = 0; i < 25; i++)
for(int i = 0; i < MAX_CHECKPOINTS; i++)
pChr->m_aCurrentTimeCp[i] = m_aCurrentTimeCp[i];
pChr->m_pPlayer->m_NotEligibleForFinish = pChr->m_pPlayer->m_NotEligibleForFinish || m_NotEligibleForFinish;

View file

@ -77,7 +77,7 @@ private:
int m_TimeCpBroadcastEndTime;
int m_LastTimeCp;
int m_LastTimeCpBroadcasted;
float m_aCurrentTimeCp[25];
float m_aCurrentTimeCp[MAX_CHECKPOINTS];
int m_NotEligibleForFinish;

View file

@ -18,7 +18,7 @@ class IGameController;
enum
{
NUM_CHECKPOINTS = 25,
NUM_CHECKPOINTS = MAX_CHECKPOINTS,
TIMESTAMP_STR_LENGTH = 20, // 2019-04-02 19:38:36
};