mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Replaced magic number with MAX_CHECKPOINTS
This commit is contained in:
parent
a69dc599a9
commit
b8840c4571
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ class IGameController;
|
|||
|
||||
enum
|
||||
{
|
||||
NUM_CHECKPOINTS = 25,
|
||||
NUM_CHECKPOINTS = MAX_CHECKPOINTS,
|
||||
TIMESTAMP_STR_LENGTH = 20, // 2019-04-02 19:38:36
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue