mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-21 19:31:26 +00:00
Interpolate minecart marks
Fixes STJr/SRB2#906 Uses the old displacement of the minecart to position the mark relative to its destination. It's not completely correct, but it works.
This commit is contained in:
parent
6c54af3774
commit
add018cb83
1 changed files with 15 additions and 0 deletions
15
src/p_user.c
15
src/p_user.c
|
@ -11038,6 +11038,21 @@ static void P_MinecartThink(player_t *player)
|
|||
S_StartSound(minecart, minecart->info->activesound);
|
||||
}
|
||||
}
|
||||
|
||||
// Mark interpolation; the old positions need to be relative to the displacement from the minecart _after_ it's moved.
|
||||
// This isn't quite correct (it captures the landing wobble) but it works well enough
|
||||
if (detleft)
|
||||
{
|
||||
detleft->old_x = detleft->x - (minecart->old_x - minecart->old_x2);
|
||||
detleft->old_y = detleft->y - (minecart->old_y - minecart->old_y2);
|
||||
detleft->old_z = detleft->z - (minecart->old_z - minecart->old_z2);
|
||||
}
|
||||
if (detright)
|
||||
{
|
||||
detright->old_x = detright->x - (minecart->old_x - minecart->old_x2);
|
||||
detright->old_y = detright->y - (minecart->old_y - minecart->old_y2);
|
||||
detright->old_z = detright->z - (minecart->old_z - minecart->old_z2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue