mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 06:12:19 +00:00
- 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:
parent
3d81be1517
commit
e223a25863
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue