SW: Lock angle and horiz right after teleporting to sprite

This commit is contained in:
NY00123 2020-04-16 21:43:14 +03:00 committed by Christoph Oelckers
parent 8e9130c31a
commit e2a789b8cc
2 changed files with 3 additions and 1 deletions

View file

@ -3281,12 +3281,13 @@ getinput(SW_PACKET *loc, SWBOOL tied)
q16angvel = fix16_clamp(q16angvel, -fix16_from_int(MAXANGVEL), fix16_from_int(MAXANGVEL));
q16aimvel = fix16_clamp(q16aimvel, -fix16_from_int(MAXHORIZVEL), fix16_from_int(MAXHORIZVEL));
void DoPlayerTeleportPause(PLAYERp pp);
if (PedanticMode)
{
q16angvel = fix16_floor(q16angvel);
q16aimvel = fix16_floor(q16aimvel);
}
else if (!TEST(pp->Flags, PF_DEAD))
else if (!TEST(pp->Flags, PF_DEAD) && (pp->DoPlayerAction != DoPlayerTeleportPause))
{
if (!TEST(pp->Flags, PF_CLIMBING) && !pp->sop_control)
DoPlayerTurn(pp, &pp->camq16ang, q16angvel);

View file

@ -1333,6 +1333,7 @@ void
DoPlayerTeleportToSprite(PLAYERp pp, SPRITEp sp)
{
pp->camq16ang = pp->q16ang = pp->oq16ang = fix16_from_int(sp->ang);
pp->camq16horiz = pp->q16horiz; // Ensure horiz is initially locked
pp->posx = pp->oposx = pp->oldposx = sp->x;
pp->posy = pp->oposy = pp->oldposy = sp->y;