Delay spawning level sign posts, do not use youfuckedup face for tied sign posts

- Sign post spawning is delayed until after thinkers have
  run. This lets ties be tallied.
- Spawn normal (non error) sign for ties.
This commit is contained in:
James R 2023-03-20 20:59:12 -07:00
parent cd7d4f23c7
commit 15edab5e85
3 changed files with 45 additions and 10 deletions

View file

@ -2054,9 +2054,6 @@ static void K_HandleLapIncrement(player_t *player)
}
P_DoPlayerExit(player);
if (!(player->pflags & PF_NOCONTEST))
P_SetupSignExit(player);
}
else
{
@ -4617,7 +4614,7 @@ static void P_SetupSignObject(mobj_t *sign, mobj_t *pmo, boolean error)
// Finds the exit sign in the current sector and
// sets its target to the player who passed the map.
//
void P_SetupSignExit(player_t *player)
void P_SetupSignExit(player_t *player, boolean tie)
{
mobj_t *thing;
msecnode_t *node = player->mo->subsector->sector->touching_thinglist; // things touching this sector
@ -4633,6 +4630,11 @@ void P_SetupSignExit(player_t *player)
if (thing->type != MT_SIGN)
continue;
if (tie)
{
break;
}
if (thing->state != &states[thing->info->spawnstate])
continue;
@ -4654,6 +4656,11 @@ void P_SetupSignExit(player_t *player)
if (thing->type != MT_SIGN)
continue;
if (tie)
{
break;
}
if (thing->state != &states[thing->info->spawnstate])
continue;
@ -4669,7 +4676,7 @@ void P_SetupSignExit(player_t *player)
{
thing = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->floorz, MT_SIGN);
thing->angle = player->mo->angle;
P_SetupSignObject(thing, player->mo, true); // Use :youfuckedup: sign face
P_SetupSignObject(thing, player->mo, (tie == false)); // Use :youfuckedup: sign face, except during ties
}
}
@ -5166,7 +5173,7 @@ static void P_ProcessExitSector(player_t *player, mtag_t sectag)
// Exit (for FOF exits; others are handled in P_PlayerThink in p_user.c)
P_DoPlayerExit(player);
P_SetupSignExit(player);
P_SetupSignExit(player, false);
#if 0
if (!G_CoopGametype())

View file

@ -600,7 +600,7 @@ struct activator_t
boolean P_CanActivateSpecial(INT16 special);
boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, char **stringargs);
void P_SetupSignExit(player_t *player);
void P_SetupSignExit(player_t *player, boolean tie);
boolean P_IsMobjTouchingSectorPlane(mobj_t *mo, sector_t *sec);
boolean P_IsMobjTouching3DFloor(mobj_t *mo, ffloor_t *ffloor, sector_t *sec);

View file

@ -629,9 +629,37 @@ void P_Ticker(boolean run)
ps_thinkertime = I_GetPreciseTime() - ps_thinkertime;
// Run any "after all the other thinkers" stuff
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
P_PlayerAfterThink(&players[i]);
{
player_t *finishingPlayers[MAXPLAYERS];
UINT8 numFinishingPlayers = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
{
P_PlayerAfterThink(&players[i]);
// Check for the number of ties for first place after every player has thunk run for this tic
if (players[i].exiting == 1 && players[i].position == 1 &&
(players[i].pflags & (PF_HITFINISHLINE|PF_NOCONTEST)) == PF_HITFINISHLINE)
{
finishingPlayers[numFinishingPlayers++] = &players[i];
}
}
}
if (numFinishingPlayers > 1)
{
for (i = 0; i < numFinishingPlayers; i++)
{
P_SetupSignExit(finishingPlayers[i], true);
}
}
else if (numFinishingPlayers == 1)
{
P_SetupSignExit(finishingPlayers[0], false);
}
}
if (K_CheckBossIntro() == true)
{