diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 011aba33b..71c62b073 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -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]); } diff --git a/src/y_inter.c b/src/y_inter.c index f4389cf86..d43e0a535 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -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; }