From 89ce257248d69238475f8713bd1251fd6d9a3f71 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 14 May 2016 23:57:56 +0100 Subject: [PATCH] Fix all the NiGHTS issues in one fell swoop (assuming they are fixed, that is, lol) Basically I kind of worked around any potential trig inaccuracies by not using the player position directly for setting momx/momy. This way, if player->angle_pos == player->old_angle_pos, momx/momy are zero --- src/p_user.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 26b60e76..ff95537e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4952,8 +4952,9 @@ static void P_NightsTransferPoints(player_t *player, fixed_t xspeed, fixed_t rad else { const angle_t fa = player->angle_pos>>ANGLETOFINESHIFT; - player->mo->momx = player->mo->target->x + FixedMul(FINECOSINE(fa),radius) - player->mo->x; - player->mo->momy = player->mo->target->y + FixedMul(FINESINE(fa),radius) - player->mo->y; + const angle_t faold = player->old_angle_pos>>ANGLETOFINESHIFT; + player->mo->momx = FixedMul(FINECOSINE(fa),radius) - FixedMul(FINECOSINE(faold),radius); + player->mo->momy = FixedMul(FINESINE(fa),radius) - FixedMul(FINESINE(faold),radius); } if (player->exiting)