- fixed: smooth teleporters could fudge the player over an adjacent line, causing the player to appear on top of a cliff that is much higher than the original teleport.

This commit is contained in:
Rachael Alexanderson 2018-10-09 06:55:56 -04:00
parent 3d81be1517
commit e223a25863

View file

@ -523,18 +523,21 @@ bool EV_SilentLineTeleport (line_t *line, int side, AActor *thing, int id, INTBO
// Is this really still necessary with real math instead of imprecise trig tables?
#if 1
const double fudgeamount = 1. / 65536.;
int side = reverse || (player && stepdown);
int fudge = FUDGEFACTOR;
double dx = line->Delta().X;
double dy = line->Delta().Y;
// Make sure we are on correct side of exit linedef.
while (P_PointOnLineSidePrecise(p, l) != side && --fudge >= 0)
{
if (fabs(dx) > fabs(dy))
p.Y -= (dx < 0) != side ? -1 : 1;
p.Y -= (dx < 0) != side ? -fudgeamount : fudgeamount;
else
p.X += (dy < 0) != side ? -1 : 1;
p.X += (dy < 0) != side ? -fudgeamount : fudgeamount;
}
#endif