mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix engine client flags not being updated under some conditions
The flags were only being updated based on rather arbitrary conditions, so they could never reset to zero or reduced. The flags are now always updated. The flags are only used in the output of the `status` command.
This commit is contained in:
parent
747fe9308f
commit
6d0806f99d
|
@ -548,8 +548,7 @@ void CServer::SetClientFlags(int ClientID, int Flags)
|
||||||
if(ClientID < 0 || ClientID >= MAX_CLIENTS || m_aClients[ClientID].m_State < CClient::STATE_READY)
|
if(ClientID < 0 || ClientID >= MAX_CLIENTS || m_aClients[ClientID].m_State < CClient::STATE_READY)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(Flags > m_aClients[ClientID].m_Flags)
|
m_aClients[ClientID].m_Flags = Flags;
|
||||||
m_aClients[ClientID].m_Flags = Flags;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CServer::Kick(int ClientID, const char *pReason)
|
void CServer::Kick(int ClientID, const char *pReason)
|
||||||
|
|
|
@ -529,8 +529,7 @@ void CPlayer::OnDirectInput(CNetObj_PlayerInput *NewInput)
|
||||||
if(Server()->IsSixup(m_ClientID))
|
if(Server()->IsSixup(m_ClientID))
|
||||||
NewInput->m_PlayerFlags = PlayerFlags_SevenToSix(NewInput->m_PlayerFlags);
|
NewInput->m_PlayerFlags = PlayerFlags_SevenToSix(NewInput->m_PlayerFlags);
|
||||||
|
|
||||||
if(NewInput->m_PlayerFlags)
|
Server()->SetClientFlags(m_ClientID, NewInput->m_PlayerFlags);
|
||||||
Server()->SetClientFlags(m_ClientID, NewInput->m_PlayerFlags);
|
|
||||||
|
|
||||||
AfkTimer();
|
AfkTimer();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue