Fault again if you spectate then respawn during a fault

This commit is contained in:
James R 2020-08-05 05:06:02 -07:00
parent ed2d40b98e
commit 3332c22801
4 changed files with 10 additions and 12 deletions

View file

@ -57,7 +57,7 @@ typedef enum
typedef enum
{
// Flip camera angle with gravity flip prefrence.
PF_FLIPCAM = 1,
PF_FAULT = 1,
// Cheats
PF_GODMODE = 1<<1,

View file

@ -8513,7 +8513,7 @@ static const char *const MAPTHINGFLAG_LIST[4] = {
static const char *const PLAYERFLAG_LIST[] = {
// Flip camera angle with gravity flip prefrence.
"FLIPCAM",
"FAULT",
// Cheats
"GODMODE",

View file

@ -2599,7 +2599,7 @@ void G_PlayerReborn(INT32 player)
jointime = players[player].jointime;
splitscreenindex = players[player].splitscreenindex;
spectator = players[player].spectator;
pflags = (players[player].pflags & (PF_TIMEOVER|PF_TAGIT|PF_TAGGED|PF_WANTSTOJOIN));
pflags = (players[player].pflags & (PF_TIMEOVER|PF_TAGIT|PF_TAGGED|PF_WANTSTOJOIN|PF_FAULT));
// As long as we're not in multiplayer, carry over cheatcodes from map to map
if (!(netgame || multiplayer))
@ -2771,11 +2771,6 @@ void G_PlayerReborn(INT32 player)
if (songcredit)
S_ShowMusicCredit();
if (leveltime > (starttime + (TICRATE/2)) && !p->spectator)
{
K_DoIngameRespawn(p);
}
if (gametype == GT_COOP)
P_FindEmerald(); // scan for emeralds to hunt for
@ -2874,7 +2869,7 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost)
P_SpawnPlayer(playernum);
if (starpost) //Don't even bother with looking for a place to spawn.
if (starpost || ( players[playernum].pflags & PF_FAULT )) //Don't even bother with looking for a place to spawn.
{
P_MovePlayerToStarpost(playernum);
#ifdef HAVE_BLUA
@ -4625,7 +4620,7 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool
memset(&players[i].respawn, 0, sizeof (players[i].respawn));
// The latter two should clear by themselves, but just in case
players[i].pflags &= ~(PF_TAGIT|PF_TAGGED|PF_FULLSTASIS);
players[i].pflags &= ~(PF_FAULT|PF_TAGIT|PF_TAGGED|PF_FULLSTASIS);
// Clear cheatcodes too, just in case.
players[i].pflags &= ~(PF_GODMODE|PF_NOCLIP|PF_INVIS);

View file

@ -97,7 +97,8 @@ void K_DoIngameRespawn(player_t *player)
return;
}
if (player->respawn.state != RESPAWNST_NONE)
if (player->respawn.state != RESPAWNST_NONE &&
( player->pflags & PF_FAULT ) == 0)
{
return;
}
@ -110,7 +111,7 @@ void K_DoIngameRespawn(player_t *player)
if (leveltime < starttime) // FAULT
{
player->powers[pw_nocontrol] = (starttime - leveltime) + 50;
player->pflags |= PF_SKIDDOWN; // cheeky pflag reuse
player->pflags |= PF_SKIDDOWN|PF_FAULT; // cheeky pflag reuse
S_StartSound(player->mo, sfx_s3k83);
player->karthud[khud_fault] = 1;
}
@ -192,6 +193,8 @@ void K_DoIngameRespawn(player_t *player)
player->respawn.pointx = beststart->x << FRACBITS;
player->respawn.pointy = beststart->y << FRACBITS;
player->mo->angle = ( beststart->angle * ANG1 );
s = R_PointInSubsector(beststart->x << FRACBITS, beststart->y << FRACBITS)->sector;
player->respawn.flip = (beststart->options & MTF_OBJECTFLIP);