mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #3450
3450: Fix veto r=Learath2 a=def- We have to check the actual player too, not just its dummies. ## 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: def <dennis@felsin9.de>
This commit is contained in:
commit
637db33737
|
@ -877,10 +877,11 @@ void CGameContext::OnTick()
|
|||
// veto right for players who have been active on server for long and who're not afk
|
||||
if(!IsKickVote() && !IsSpecVote() && g_Config.m_SvVoteVetoTime)
|
||||
{
|
||||
// look through all players with same IP again
|
||||
for(int j = i + 1; j < MAX_CLIENTS; j++)
|
||||
// look through all players with same IP again, including the current player
|
||||
for(int j = i; j < MAX_CLIENTS; j++)
|
||||
{
|
||||
if(!m_apPlayers[j] || str_comp(aaBuf[j], aaBuf[i]) != 0)
|
||||
// no need to check ip address of current player
|
||||
if(i != j && (!m_apPlayers[j] || str_comp(aaBuf[j], aaBuf[i]) != 0))
|
||||
continue;
|
||||
|
||||
if(m_apPlayers[j] && !m_apPlayers[j]->m_Afk && m_apPlayers[j]->GetTeam() != TEAM_SPECTATORS &&
|
||||
|
|
Loading…
Reference in a new issue