Fixed voting to not crash the server when votes time out. Whoops.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2981 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
9b33803764
commit
594c81c3b5
1 changed files with 8 additions and 1 deletions
|
@ -2930,7 +2930,7 @@ void VoteCheckTimes(void)
|
|||
{
|
||||
voteinfo_t *vote, *prev;
|
||||
prev = NULL;
|
||||
for (vote = voteinfo; vote; vote = vote->next)
|
||||
for (vote = voteinfo; vote; )
|
||||
{
|
||||
if (vote->timeout < realtime)
|
||||
{
|
||||
|
@ -2940,9 +2940,16 @@ void VoteCheckTimes(void)
|
|||
voteinfo = vote->next;
|
||||
|
||||
Z_Free(vote);
|
||||
|
||||
if (prev)
|
||||
vote = prev;
|
||||
else
|
||||
vote = voteinfo;
|
||||
}
|
||||
else
|
||||
prev = vote;
|
||||
|
||||
vote = vote->next;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue