Fix NiGHTS Bumper player positioning

This commit is contained in:
mazmazz 2018-08-15 18:42:20 -04:00
parent f19b7bfacf
commit 55d2da2201
2 changed files with 10 additions and 7 deletions

View file

@ -1005,13 +1005,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
player->flyangle = special->threshold;
player->speed = FixedMul(special->info->speed, special->scale);
// Potentially causes axis transfer failures.
// Also rarely worked properly anyway.
//P_UnsetThingPosition(player->mo);
//player->mo->x = special->x;
//player->mo->y = special->y;
//P_SetThingPosition(player->mo);
toucher->z = special->z+(special->height/4);
P_SetTarget(&player->mo->hnext, special); // Reference bumper for position correction on next tic
}
else // More like a spring
{

View file

@ -6175,6 +6175,15 @@ static void P_NiGHTSMovement(player_t *player)
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_TeleportMove(player->mo, player->mo->hnext->x, player->mo->hnext->y, player->mo->hnext->z + (player->mo->hnext->height/4));
P_SetTarget(&player->mo->hnext, NULL);
}
if (player->mo->z < player->mo->floorz)
player->mo->z = player->mo->floorz;