From f17f6b752588e34351b14005c35c993a4b6db625 Mon Sep 17 00:00:00 2001 From: JugadorXEI Date: Wed, 30 Mar 2022 15:25:35 +0200 Subject: [PATCH] banishing hell map forcing # Conflicts: # src/d_netcmd.c # src/y_inter.c --- src/d_netcmd.c | 13 ++++----- src/doomstat.h | 2 +- src/g_game.c | 2 +- src/y_inter.c | 76 +++++++++++++++++++++----------------------------- 4 files changed, 39 insertions(+), 54 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 7e8143427..9ebd47436 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2433,11 +2433,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[4] = {-1,-1,-1, 0}; + INT16 votebuffer[4] = {-1,-1,-1,0}; if ((cv_kartencore.value == 1) && (gametyperules & GTR_CIRCUIT)) WRITEUINT8(p, (gametype|0x80)); @@ -2446,7 +2446,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 @@ -2508,10 +2508,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 { @@ -4883,7 +4880,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 791504815..3ed2cfa5d 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -720,7 +720,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 68286da99..60261e368 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -311,7 +311,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 d66a82dcb..0f2a319bf 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1338,9 +1338,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! @@ -1625,7 +1625,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; @@ -1633,42 +1633,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 %d", + 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 %d", - 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 %d", + 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 %d", - 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]) @@ -1719,7 +1713,7 @@ static void Y_UnloadVoteData(void) UNLOAD(rubyicon); // to prevent double frees... - for (i = 0; i < 5; i++) + for (i = 0; i < 4; i++) { // I went to all the trouble of doing this, // but literally nowhere else frees level pics. @@ -1729,7 +1723,7 @@ static void Y_UnloadVoteData(void) if (!levelinfo[i].pic) continue; - for (j = i+1; j < 5; j++) + for (j = i+1; j < 4; j++) { if (levelinfo[j].pic == levelinfo[i].pic) levelinfo[j].pic = NULL; @@ -1772,12 +1766,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; @@ -1790,7 +1778,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);