diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 84c1045a..e3f861ae 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2393,11 +2393,11 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pencoremode, boolean r void D_SetupVote(void) { - UINT8 buf[6*2]; // five UINT16 maps (at twice the width of a UINT8), and two gametypes + UINT8 buf[5*2]; // four UINT16 maps (at twice the width of a UINT8), and two gametypes UINT8 *p = buf; INT32 i; UINT8 secondgt = G_SometimesGetDifferentGametype(); - INT16 votebuffer[3] = {-1,-1,-1}; + INT16 votebuffer[4] = {-1,-1,-1,0}; if (cv_kartencore.value && G_RaceGametype()) WRITEUINT8(p, (gametype|0x80)); @@ -2406,7 +2406,7 @@ void D_SetupVote(void) WRITEUINT8(p, secondgt); secondgt &= ~0x80; - for (i = 0; i < 5; i++) + for (i = 0; i < 4; i++) { UINT16 m; if (i == 2) // sometimes a different gametype @@ -2469,10 +2469,7 @@ void D_PickVote(void) if (numvotes > 0) { WRITESINT8(p, temppicks[key]); - if (force && templevels[key] == 3 && numvotes > 1) - WRITESINT8(p, 4); - else - WRITESINT8(p, templevels[key]); + WRITESINT8(p, templevels[key]); } else { @@ -5144,7 +5141,7 @@ static void Got_SetupVotecmd(UINT8 **cp, INT32 playernum) gt = (UINT8)READUINT8(*cp); secondgt = (UINT8)READUINT8(*cp); - for (i = 0; i < 5; i++) + for (i = 0; i < 4; i++) { votelevels[i][0] = (UINT16)READUINT16(*cp); votelevels[i][1] = gt; diff --git a/src/doomstat.h b/src/doomstat.h index 232a5af8..28db4068 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -482,7 +482,7 @@ extern boolean legitimateexit; extern boolean comebackshowninfo; extern tic_t curlap, bestlap; -extern INT16 votelevels[5][2]; +extern INT16 votelevels[4][2]; extern SINT8 votes[MAXPLAYERS]; extern SINT8 pickedvote; diff --git a/src/g_game.c b/src/g_game.c index c51f63cd..1fb2ceae 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -262,7 +262,7 @@ boolean franticitems; // Frantic items currently enabled? boolean comeback; // Battle Mode's karma comeback is on/off // Voting system -INT16 votelevels[5][2]; // Levels that were rolled by the host +INT16 votelevels[4][2]; // Levels that were rolled by the host SINT8 votes[MAXPLAYERS]; // Each player's vote SINT8 pickedvote; // What vote the host rolls diff --git a/src/y_inter.c b/src/y_inter.c index c01c611e..a6dd2d81 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1219,9 +1219,9 @@ static void Y_VoteStops(SINT8 pick, SINT8 level) { nextmap = votelevels[level][0]; - if (level == 4) - S_StartSound(NULL, sfx_noooo2); // gasp - else if (mapheaderinfo[nextmap] && (mapheaderinfo[nextmap]->menuflags & LF2_HIDEINMENU)) + //if (level == 4) + // S_StartSound(NULL, sfx_noooo2); // gasp + if (mapheaderinfo[nextmap] && (mapheaderinfo[nextmap]->menuflags & LF2_HIDEINMENU)) S_StartSound(NULL, sfx_noooo1); // this is bad else if (netgame && P_IsLocalPlayer(&players[pick])) S_StartSound(NULL, sfx_yeeeah); // yeeeah! @@ -1481,7 +1481,7 @@ void Y_StartVote(void) for (i = 0; i < MAXPLAYERS; i++) votes[i] = -1; - for (i = 0; i < 5; i++) + for (i = 0; i < 4; i++) { lumpnum_t lumpnum; @@ -1489,42 +1489,36 @@ void Y_StartVote(void) levelinfo[i].encore = (votelevels[i][1] & 0x80); votelevels[i][1] &= ~0x80; - // set up the str - if (i == 4) - levelinfo[i].str[0] = '\0'; + // set up the levelstring + if (mapheaderinfo[votelevels[i][0]]->levelflags & LF_NOZONE || !mapheaderinfo[votelevels[i][0]]->zonttl[0]) + { + if (mapheaderinfo[votelevels[i][0]]->actnum[0]) + snprintf(levelinfo[i].str, + sizeof levelinfo[i].str, + "%s %s", + mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->actnum); + else + snprintf(levelinfo[i].str, + sizeof levelinfo[i].str, + "%s", + mapheaderinfo[votelevels[i][0]]->lvlttl); + } else { - // set up the levelstring - if (mapheaderinfo[votelevels[i][0]]->levelflags & LF_NOZONE || !mapheaderinfo[votelevels[i][0]]->zonttl[0]) - { - if (mapheaderinfo[votelevels[i][0]]->actnum[0]) - snprintf(levelinfo[i].str, - sizeof levelinfo[i].str, - "%s %s", - mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->actnum); - else - snprintf(levelinfo[i].str, - sizeof levelinfo[i].str, - "%s", - mapheaderinfo[votelevels[i][0]]->lvlttl); - } + if (mapheaderinfo[votelevels[i][0]]->actnum[0]) + snprintf(levelinfo[i].str, + sizeof levelinfo[i].str, + "%s %s %s", + mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->zonttl, mapheaderinfo[votelevels[i][0]]->actnum); else - { - if (mapheaderinfo[votelevels[i][0]]->actnum[0]) - snprintf(levelinfo[i].str, - sizeof levelinfo[i].str, - "%s %s %s", - mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->zonttl, mapheaderinfo[votelevels[i][0]]->actnum); - else - snprintf(levelinfo[i].str, - sizeof levelinfo[i].str, - "%s %s", - mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->zonttl); - } - - levelinfo[i].str[sizeof levelinfo[i].str - 1] = '\0'; + snprintf(levelinfo[i].str, + sizeof levelinfo[i].str, + "%s %s", + mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->zonttl); } + levelinfo[i].str[sizeof levelinfo[i].str - 1] = '\0'; + // set up the gtc and gts levelinfo[i].gtc = G_GetGametypeColor(votelevels[i][1]); if (i == 2 && votelevels[i][1] != votelevels[0][1]) @@ -1572,7 +1566,6 @@ static void Y_UnloadVoteData(void) UNLOAD(randomlvl); UNLOAD(rubyicon); - UNLOAD(levelinfo[4].pic); UNLOAD(levelinfo[3].pic); UNLOAD(levelinfo[2].pic); UNLOAD(levelinfo[1].pic); @@ -1610,12 +1603,6 @@ void Y_SetupVoteFinish(SINT8 pick, SINT8 level) if (votes[i] == -1 || endtype > 1) // Don't need to go on continue; - if (level == 4) - { - votes[i] = 4; - continue; - } - if (endtype == 2) continue; @@ -1628,7 +1615,7 @@ void Y_SetupVoteFinish(SINT8 pick, SINT8 level) endtype = 2; } - if (level == 4 || endtype == 1) // Only one unique vote, so just end it immediately. + if (endtype == 1) // Only one unique vote, so just end it immediately. { voteendtic = votetic + (5*TICRATE); S_ChangeMusicInternal("voteeb", false);