mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Make followers only stretch for their movement *relative* to the player, not their movement in general.
This commit is contained in:
parent
316cd61d9f
commit
a749160c6b
1 changed files with 5 additions and 1 deletions
|
|
@ -3915,7 +3915,7 @@ static void P_HandleFollower(player_t *player)
|
|||
follower_t fl;
|
||||
angle_t an;
|
||||
fixed_t zoffs;
|
||||
fixed_t sx, sy, sz;
|
||||
fixed_t sx, sy, sz, deltaz;
|
||||
UINT16 color;
|
||||
|
||||
fixed_t bubble; // bubble scale (0 if no bubble)
|
||||
|
|
@ -3949,6 +3949,9 @@ static void P_HandleFollower(player_t *player)
|
|||
sx = player->mo->x + FixedMul((player->mo->scale*fl.dist), FINECOSINE((an)>>ANGLETOFINESHIFT));
|
||||
sy = player->mo->y + FixedMul((player->mo->scale*fl.dist), FINESINE((an)>>ANGLETOFINESHIFT));
|
||||
|
||||
// interp info helps with stretchy fix
|
||||
deltaz = (player->mo->z - player->mo->old_z);
|
||||
|
||||
// for the z coordinate, don't be a doof like Steel and forget that MFE_VERTICALFLIP exists :P
|
||||
sz = player->mo->z + FixedMul(player->mo->scale, zoffs)*P_MobjFlip(player->mo);
|
||||
if (player->mo->eflags & MFE_VERTICALFLIP)
|
||||
|
|
@ -4032,6 +4035,7 @@ static void P_HandleFollower(player_t *player)
|
|||
// 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->z += deltaz/ (INT32)fl.vertlag;
|
||||
player->follower->momz = (sz - player->follower->z)/ (INT32)fl.vertlag;
|
||||
player->follower->angle = player->mo->angle;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue