Merge branch 'dont-cheese-fault' into 'master'

Fault again if you spectate then respawn during a fault

See merge request KartKrew/Kart!315
This commit is contained in:
Sal 2020-09-25 09:31:37 -04:00
commit e1c5acffb9
6 changed files with 18 additions and 18 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,
@ -113,7 +113,8 @@ typedef enum
// Spill rings after falling
PF_NIGHTSFALL = 1<<24,
PF_DRILLING = 1<<25,
PF_SKIDDOWN = 1<<26,
// free: 1<<26
/*** TAG STUFF ***/
PF_TAGGED = 1<<27, // Player has been tagged and awaits the next round in hide and seek.

View file

@ -8515,7 +8515,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",
@ -8571,7 +8571,8 @@ static const char *const PLAYERFLAG_LIST[] = {
// Spill rings after falling
"NIGHTSFALL",
"DRILLING",
"SKIDDOWN",
"\x01", // free: 1<<26 (name un-matchable)
/*** TAG STUFF ***/
"TAGGED", // Player has been tagged and awaits the next round in hide and seek.

View file

@ -2610,7 +2610,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))
@ -2782,11 +2782,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
@ -2885,7 +2880,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
@ -4636,7 +4631,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

@ -3649,7 +3649,7 @@ void K_DriftDustHandling(mobj_t *spawner)
if (spawner->player)
{
if (spawner->player->pflags & PF_SKIDDOWN)
if (spawner->player->pflags & PF_FAULT)
{
anglediff = abs((signed)(spawner->angle - spawner->player->frameangle));
if (leveltime % 6 == 0)
@ -5471,7 +5471,7 @@ void K_KartPlayerHUDUpdate(player_t *player)
if (player->karthud[khud_tauntvoices])
player->karthud[khud_tauntvoices]--;
if (!(player->pflags & PF_SKIDDOWN))
if (!(player->pflags & PF_FAULT))
player->karthud[khud_fault] = 0;
else if (player->karthud[khud_fault] > 0 && player->karthud[khud_fault] < 2*TICRATE)
player->karthud[khud_fault]++;

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_FAULT;
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);

View file

@ -5785,7 +5785,7 @@ static void P_MovePlayer(player_t *player)
else
player->frameangle -= (ANGLE_11hh * speed);
}
else if (player->powers[pw_nocontrol] && player->pflags & PF_SKIDDOWN)
else if (player->powers[pw_nocontrol] && player->pflags & PF_FAULT)
{
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
@ -8957,7 +8957,7 @@ void P_PlayerThink(player_t *player)
if (player->powers[pw_nocontrol] & ((1<<15)-1) && player->powers[pw_nocontrol] < UINT16_MAX)
{
if (!(--player->powers[pw_nocontrol]))
player->pflags &= ~PF_SKIDDOWN;
player->pflags &= ~PF_FAULT;
}
else
player->powers[pw_nocontrol] = 0;