SW: Don't interpolate a non-remote sector object controlled

by the player. Make sure looking up/down is still smooth.
This commit is contained in:
NY00123 2020-05-01 18:10:48 +03:00 committed by Christoph Oelckers
parent bdacab366a
commit 5baba6b9f3
2 changed files with 9 additions and 5 deletions

View file

@ -2053,7 +2053,7 @@ drawscreen(PLAYERp pp)
tq16ang = camerapp->oq16ang + mulscale16(NORM_Q16ANGLE(camerapp->q16ang + fix16_from_int(1024) - camerapp->oq16ang) - fix16_from_int(1024), smoothratio);
tq16horiz = camerapp->oq16horiz + mulscale16(camerapp->q16horiz - camerapp->oq16horiz, smoothratio);
}
else if (gs.InterpolateSO)
else if (gs.InterpolateSO && (!CommEnabled || !pp->sop_control))
{
tq16ang = camerapp->oq16ang + mulscale16(((pp->camq16ang + fix16_from_int(1024) - camerapp->oq16ang) & 0x7FFFFFF) - fix16_from_int(1024), smoothratio);
tq16horiz = camerapp->oq16horiz + mulscale16(pp->camq16horiz - camerapp->oq16horiz, smoothratio);
@ -2095,7 +2095,8 @@ drawscreen(PLAYERp pp)
if (pp->sop_riding || pp->sop_control)
{
if (pp->sop_control && !gs.InterpolateSO)
if (pp->sop_control &&
(!gs.InterpolateSO || (CommEnabled && !pp->sop_remote)))
{
tx = pp->posx;
ty = pp->posy;

View file

@ -251,9 +251,12 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b
if (sop->xmid == INT32_MAX /*|| sop->xmid == MAXSO*/)
continue;
// Unfortunately, interpolating over less samples doesn't
// work well in multiplayer, so conditionally disable this
if (CommEnabled && (interp->lasttic != synctics))
// Unfortunately, interpolating over less samples doesn't work well in
// multiplayer. Same with sector objects controlled and carrying the player.
if (CommEnabled &&
((interp->lasttic != synctics) ||
((Player[screenpeek].sop_control == sop) &&
!Player[screenpeek].sop_remote)))
continue;
for (i = 0, data = interp->data; i < interp->numinterpolations; i++, data++)