4337: Fix DbgDummy check being at the wrong place r=def- a=heinrich5991

Fixes #4325.

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
This commit is contained in:
bors[bot] 2021-11-08 15:11:43 +00:00 committed by GitHub
commit 455ee32754
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -165,21 +165,25 @@ static int PlayerFlags_SixToSeven(int Flags)
void CPlayer::Tick()
{
#ifdef CONF_DEBUG
if(!g_Config.m_DbgDummies || m_ClientID < MAX_CLIENTS - g_Config.m_DbgDummies)
#endif
if(m_ScoreQueryResult != nullptr && m_ScoreQueryResult->m_Completed)
{
ProcessScoreResult(*m_ScoreQueryResult);
m_ScoreQueryResult = nullptr;
}
if(m_ScoreQueryResult != nullptr && m_ScoreQueryResult->m_Completed)
{
ProcessScoreResult(*m_ScoreQueryResult);
m_ScoreQueryResult = nullptr;
}
if(m_ScoreFinishResult != nullptr && m_ScoreFinishResult->m_Completed)
{
ProcessScoreResult(*m_ScoreFinishResult);
m_ScoreFinishResult = nullptr;
}
if(!Server()->ClientIngame(m_ClientID))
bool ClientIngame = Server()->ClientIngame(m_ClientID);
#ifdef CONF_DEBUG
if(g_Config.m_DbgDummies && m_ClientID >= MAX_CLIENTS - g_Config.m_DbgDummies)
{
ClientIngame = true;
}
#endif
if(!ClientIngame)
return;
if(m_ChatScore > 0)