From 678935f26aa6a38320db9cd8c881764866dbbd69 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sun, 23 Feb 2020 17:02:50 -0300 Subject: [PATCH] Turn players IT if they join the game after the hide time in tag gametypes Except in gametypes with hide time stasis, because they can't change team. --- src/d_netcmd.c | 2 +- src/g_game.c | 2 +- src/p_inter.c | 2 +- src/p_user.c | 6 +++--- src/st_stuff.c | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 3c17987e1..a77ea0dd5 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2775,7 +2775,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) players[playernum].spectator = false; //If joining after hidetime in normal tag, default to being IT. - if (gametype == GT_TAG && (leveltime > (hidetime * TICRATE))) + if (((gametyperules & (GTR_TAG|GTR_HIDEFROZEN)) == GTR_TAG) && (leveltime > (hidetime * TICRATE))) { NetPacket.packet.newteam = 1; //minor hack, causes the "is it" message to be printed later. players[playernum].pflags |= PF_TAGIT; //make the player IT. diff --git a/src/g_game.c b/src/g_game.c index 265fb115f..47226931a 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3221,7 +3221,7 @@ UINT32 gametypedefaultrules[NUMGAMETYPES] = // Tag GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_STARTCOUNTDOWN|GTR_BLINDFOLDED|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY, // Hide and Seek - GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_STARTCOUNTDOWN|GTR_BLINDFOLDED|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY, + GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_STARTCOUNTDOWN|GTR_HIDEFROZEN|GTR_BLINDFOLDED|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY, // CTF GTR_RINGSLINGER|GTR_FIRSTPERSON|GTR_SPECTATORS|GTR_TEAMS|GTR_TEAMFLAGS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_POWERSTONES|GTR_DEATHMATCHSTARTS|GTR_SPAWNINVUL|GTR_RESPAWNDELAY|GTR_PITYSHIELD, diff --git a/src/p_inter.c b/src/p_inter.c index cc8d5db6b..800f07d83 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2285,7 +2285,7 @@ void P_CheckSurvivors(void) if (!taggers) //If there are no taggers, pick a survivor at random to be it. { // Exception for hide and seek. If a round has started and the IT player leaves, end the round. - if (gametype == GT_HIDEANDSEEK && (leveltime >= (hidetime * TICRATE))) + if ((gametyperules & GTR_HIDEFROZEN) && (leveltime >= (hidetime * TICRATE))) { CONS_Printf(M_GetText("The IT player has left the game.\n")); if (server) diff --git a/src/p_user.c b/src/p_user.c index 880d932af..a481969cf 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -392,7 +392,7 @@ void P_GiveFinishFlags(player_t *player) mobj_t* flag = P_SpawnMobjFromMobj(player->mo, xoffs, yoffs, 0, MT_FINISHFLAG); flag->angle = angle; angle += FixedAngle(120*FRACUNIT); - + P_SetTarget(&flag->target, player->mo); } } @@ -3679,7 +3679,7 @@ static boolean PIT_CheckSolidsTeeter(mobj_t *thing) if (thing == teeterer) return true; - if (thing->player && cv_tailspickup.value && gametype != GT_HIDEANDSEEK) + if (thing->player && cv_tailspickup.value && !(gametyperules & GTR_HIDEFROZEN)) return true; blockdist = teeterer->radius + thing->radius; @@ -8034,7 +8034,7 @@ static void P_MovePlayer(player_t *player) if (player->pflags & PF_TAGIT) forcestasis = true; } - else if (gametype == GT_HIDEANDSEEK) + else if (gametyperules & GTR_HIDEFROZEN) { if (!(player->pflags & PF_TAGIT)) { diff --git a/src/st_stuff.c b/src/st_stuff.c index 4864f2af6..1e792db79 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1444,7 +1444,7 @@ static void ST_drawPowerupHUD(void) if (stplyr->spectator || stplyr->playerstate != PST_LIVE) return; - + // --------- // Finish icon // --------- @@ -2363,12 +2363,12 @@ static void ST_drawTextHUD(void) textHUDdraw(M_GetText("\x82""You are blindfolded!")) textHUDdraw(M_GetText("Waiting for players to hide...")) } - else if (gametype == GT_HIDEANDSEEK) + else if (gametyperules & GTR_HIDEFROZEN) textHUDdraw(M_GetText("Hide before time runs out!")) else textHUDdraw(M_GetText("Flee before you are hunted!")) } - else if (gametype == GT_HIDEANDSEEK && !(stplyr->pflags & PF_TAGIT)) + else if ((gametyperules & GTR_HIDEFROZEN) && !(stplyr->pflags & PF_TAGIT)) { if (!splitscreen && !donef12) {