Fix the servers crashing when suddenly exiting voting (ie everyone leaves)
This commit is contained in:
parent
2e4aea934d
commit
c8d54b4546
2 changed files with 9 additions and 2 deletions
|
|
@ -3216,10 +3216,9 @@ void D_PickVote(void)
|
|||
}
|
||||
}
|
||||
|
||||
key = M_RandomKey(numvotes);
|
||||
|
||||
if (numvotes > 0)
|
||||
{
|
||||
key = M_RandomKey(numvotes);
|
||||
WRITESINT8(p, temppicks[key]);
|
||||
WRITESINT8(p, templevels[key]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2011,6 +2011,14 @@ void Y_StartVote(void)
|
|||
//
|
||||
void Y_EndVote(void)
|
||||
{
|
||||
if (nextmap >= NEXTMAP_SPECIAL)
|
||||
{
|
||||
// Don't leave nextmap unset if the vote is ended through
|
||||
// weird means! (such as a dedicated server becoming empty)
|
||||
// If nextmap was left at NEXTMAP_VOTING, we'd crash!
|
||||
Y_VoteStops(0, 0);
|
||||
}
|
||||
|
||||
Y_UnloadVoteData();
|
||||
voteendtic = -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue