1
0
Fork 0
forked from fte/fteqw

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:
Spoike 2008-05-26 21:50:11 +00:00
parent 9b33803764
commit 594c81c3b5

View file

@ -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;
}
}