mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-16 01:31:30 +00:00
Also center non-NiGHTS players on NiGHTS bumpers
This commit is contained in:
parent
67da64a064
commit
432c1ab862
1 changed files with 12 additions and 14 deletions
26
src/p_user.c
26
src/p_user.c
|
@ -6174,20 +6174,6 @@ static void P_NiGHTSMovement(player_t *player)
|
|||
// S_StartSound(NULL, sfx_timeup); // that creepy "out of time" music from NiGHTS. Dummied out, as some on the dev team thought it wasn't Sonic-y enough (Mystic, notably). Uncomment to restore. -SH
|
||||
S_ChangeMusicInternal((((maptol & TOL_NIGHTS) && !G_IsSpecialStage(gamemap)) ? "_ntime" : "_drown"), false);
|
||||
|
||||
|
||||
if (player->bumpertime == TICRATE/2)
|
||||
{
|
||||
// Center player to bumper here because if you try to set player's position in P_TouchSpecialThing case MT_NIGHTSBUMPER,
|
||||
// that position is fudged in the time between that routine in the previous tic
|
||||
// and reaching here in the current tic
|
||||
P_UnsetThingPosition(player->mo);
|
||||
player->mo->x = player->mo->hnext->x;
|
||||
player->mo->y = player->mo->hnext->y;
|
||||
player->mo->z = player->mo->hnext->z + FixedMul(player->mo->hnext->height/4, player->mo->hnext->scale);
|
||||
P_SetThingPosition(player->mo);
|
||||
P_SetTarget(&player->mo->hnext, NULL);
|
||||
}
|
||||
|
||||
if (player->mo->z < player->mo->floorz)
|
||||
player->mo->z = player->mo->floorz;
|
||||
|
||||
|
@ -9821,7 +9807,19 @@ void P_PlayerThink(player_t *player)
|
|||
P_ResetScore(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (player->bumpertime == TICRATE/2 && player->mo->hnext)
|
||||
{
|
||||
// Center player to NiGHTS bumper here because if you try to set player's position in
|
||||
// P_TouchSpecialThing case MT_NIGHTSBUMPER, that position is fudged in the time
|
||||
// between that routine in the previous tic
|
||||
// and reaching here in the current tic
|
||||
P_TeleportMove(player->mo, player->mo->hnext->x, player->mo->hnext->y
|
||||
, player->mo->hnext->z + FixedMul(player->mo->hnext->height/4, player->mo->hnext->scale));
|
||||
P_SetTarget(&player->mo->hnext, NULL);
|
||||
}
|
||||
P_MovePlayer(player);
|
||||
}
|
||||
|
||||
if (!player->mo)
|
||||
return; // P_MovePlayer removed player->mo.
|
||||
|
|
Loading…
Reference in a new issue