mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +00:00
Replace IConsole::m_Cheated
variable with Cheated
getter
Interfaces should not have member variables, so the variable is moved to `CConsole`. Only a getter `IConsole::Cheated` is added because the cheated state of the console is never reset.
This commit is contained in:
parent
c216567431
commit
e410dd85f8
|
@ -126,7 +126,7 @@ public:
|
||||||
|
|
||||||
// DDRace
|
// DDRace
|
||||||
|
|
||||||
bool m_Cheated;
|
virtual bool Cheated() const = 0;
|
||||||
|
|
||||||
virtual int FlagMask() const = 0;
|
virtual int FlagMask() const = 0;
|
||||||
virtual void SetFlagMask(int FlagMask) = 0;
|
virtual void SetFlagMask(int FlagMask) = 0;
|
||||||
|
|
|
@ -191,6 +191,8 @@ class CConsole : public IConsole
|
||||||
void AddCommandSorted(CCommand *pCommand);
|
void AddCommandSorted(CCommand *pCommand);
|
||||||
CCommand *FindCommand(const char *pName, int FlagMask);
|
CCommand *FindCommand(const char *pName, int FlagMask);
|
||||||
|
|
||||||
|
bool m_Cheated;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IConfigManager *ConfigManager() { return m_pConfigManager; }
|
IConfigManager *ConfigManager() { return m_pConfigManager; }
|
||||||
CConfig *Config() { return m_pConfig; }
|
CConfig *Config() { return m_pConfig; }
|
||||||
|
@ -228,6 +230,8 @@ public:
|
||||||
|
|
||||||
static void ConUserCommandStatus(IConsole::IResult *pResult, void *pUser);
|
static void ConUserCommandStatus(IConsole::IResult *pResult, void *pUser);
|
||||||
|
|
||||||
|
bool Cheated() const override { return m_Cheated; }
|
||||||
|
|
||||||
int FlagMask() const override { return m_FlagMask; }
|
int FlagMask() const override { return m_FlagMask; }
|
||||||
void SetFlagMask(int FlagMask) override { m_FlagMask = FlagMask; }
|
void SetFlagMask(int FlagMask) override { m_FlagMask = FlagMask; }
|
||||||
};
|
};
|
||||||
|
|
|
@ -143,7 +143,7 @@ void CScore::MapInfo(int ClientID, const char *pMapName)
|
||||||
void CScore::SaveScore(int ClientID, float Time, const char *pTimestamp, const float aTimeCp[NUM_CHECKPOINTS], bool NotEligible)
|
void CScore::SaveScore(int ClientID, float Time, const char *pTimestamp, const float aTimeCp[NUM_CHECKPOINTS], bool NotEligible)
|
||||||
{
|
{
|
||||||
CConsole *pCon = (CConsole *)GameServer()->Console();
|
CConsole *pCon = (CConsole *)GameServer()->Console();
|
||||||
if(pCon->m_Cheated || NotEligible)
|
if(pCon->Cheated() || NotEligible)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CPlayer *pCurPlayer = GameServer()->m_apPlayers[ClientID];
|
CPlayer *pCurPlayer = GameServer()->m_apPlayers[ClientID];
|
||||||
|
@ -166,7 +166,7 @@ void CScore::SaveScore(int ClientID, float Time, const char *pTimestamp, const f
|
||||||
void CScore::SaveTeamScore(int *pClientIDs, unsigned int Size, float Time, const char *pTimestamp)
|
void CScore::SaveTeamScore(int *pClientIDs, unsigned int Size, float Time, const char *pTimestamp)
|
||||||
{
|
{
|
||||||
CConsole *pCon = (CConsole *)GameServer()->Console();
|
CConsole *pCon = (CConsole *)GameServer()->Console();
|
||||||
if(pCon->m_Cheated)
|
if(pCon->Cheated())
|
||||||
return;
|
return;
|
||||||
for(unsigned int i = 0; i < Size; i++)
|
for(unsigned int i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue