Also center non-NiGHTS players on NiGHTS bumpers

This commit is contained in:
mazmazz 2018-08-15 19:09:54 -04:00
parent 67da64a064
commit 432c1ab862

View file

@ -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.