mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
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:
parent
cd7d4f23c7
commit
15edab5e85
3 changed files with 45 additions and 10 deletions
19
src/p_spec.c
19
src/p_spec.c
|
|
@ -2054,9 +2054,6 @@ static void K_HandleLapIncrement(player_t *player)
|
||||||
}
|
}
|
||||||
|
|
||||||
P_DoPlayerExit(player);
|
P_DoPlayerExit(player);
|
||||||
|
|
||||||
if (!(player->pflags & PF_NOCONTEST))
|
|
||||||
P_SetupSignExit(player);
|
|
||||||
}
|
}
|
||||||
else
|
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
|
// Finds the exit sign in the current sector and
|
||||||
// sets its target to the player who passed the map.
|
// 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;
|
mobj_t *thing;
|
||||||
msecnode_t *node = player->mo->subsector->sector->touching_thinglist; // things touching this sector
|
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)
|
if (thing->type != MT_SIGN)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (tie)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (thing->state != &states[thing->info->spawnstate])
|
if (thing->state != &states[thing->info->spawnstate])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
@ -4654,6 +4656,11 @@ void P_SetupSignExit(player_t *player)
|
||||||
if (thing->type != MT_SIGN)
|
if (thing->type != MT_SIGN)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (tie)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (thing->state != &states[thing->info->spawnstate])
|
if (thing->state != &states[thing->info->spawnstate])
|
||||||
continue;
|
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 = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->floorz, MT_SIGN);
|
||||||
thing->angle = player->mo->angle;
|
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)
|
// Exit (for FOF exits; others are handled in P_PlayerThink in p_user.c)
|
||||||
P_DoPlayerExit(player);
|
P_DoPlayerExit(player);
|
||||||
|
|
||||||
P_SetupSignExit(player);
|
P_SetupSignExit(player, false);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (!G_CoopGametype())
|
if (!G_CoopGametype())
|
||||||
|
|
|
||||||
|
|
@ -600,7 +600,7 @@ struct activator_t
|
||||||
boolean P_CanActivateSpecial(INT16 special);
|
boolean P_CanActivateSpecial(INT16 special);
|
||||||
boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, char **stringargs);
|
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_IsMobjTouchingSectorPlane(mobj_t *mo, sector_t *sec);
|
||||||
boolean P_IsMobjTouching3DFloor(mobj_t *mo, ffloor_t *ffloor, sector_t *sec);
|
boolean P_IsMobjTouching3DFloor(mobj_t *mo, ffloor_t *ffloor, sector_t *sec);
|
||||||
|
|
|
||||||
28
src/p_tick.c
28
src/p_tick.c
|
|
@ -629,10 +629,38 @@ void P_Ticker(boolean run)
|
||||||
ps_thinkertime = I_GetPreciseTime() - ps_thinkertime;
|
ps_thinkertime = I_GetPreciseTime() - ps_thinkertime;
|
||||||
|
|
||||||
// Run any "after all the other thinkers" stuff
|
// Run any "after all the other thinkers" stuff
|
||||||
|
{
|
||||||
|
player_t *finishingPlayers[MAXPLAYERS];
|
||||||
|
UINT8 numFinishingPlayers = 0;
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
{
|
||||||
if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
|
if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
|
||||||
|
{
|
||||||
P_PlayerAfterThink(&players[i]);
|
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)
|
if (K_CheckBossIntro() == true)
|
||||||
{
|
{
|
||||||
// Bosses have a punchy start, so no position.
|
// Bosses have a punchy start, so no position.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue