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:
bors[bot] 2020-12-28 11:02:09 +00:00 committed by GitHub
commit 637db33737
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 &&