From caf1ed37ac01714d6bbf108b276db5536d2d8b71 Mon Sep 17 00:00:00 2001 From: SinnamonLat Date: Thu, 2 Sep 2021 08:17:43 +0200 Subject: [PATCH] fix janky follower movements due to lag type being changed from int32 to uint32 in the struct --- src/p_user.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index d577faab2..a8523bdf6 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3918,9 +3918,10 @@ static void P_HandleFollower(player_t *player) P_SetFollowerState(player->follower, player->follower->state->nextstate); // move the follower next to us (yes, this is really basic maths but it looks pretty damn clean in practice)! - player->follower->momx = (sx - player->follower->x)/fl.horzlag; - player->follower->momy = (sy - player->follower->y)/fl.horzlag; - player->follower->momz = (sz - player->follower->z)/fl.vertlag; + // 02/09/2021: cast lag to int32 otherwise funny things happen since it was changed to uint32 in the struct + player->follower->momx = (sx - player->follower->x)/ (INT32)fl.horzlag; + player->follower->momy = (sy - player->follower->y)/ (INT32)fl.horzlag; + player->follower->momz = (sz - player->follower->z)/ (INT32)fl.vertlag; player->follower->angle = player->mo->angle; if (player->mo->colorized)