mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 20:43:15 +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?
|
// Is this really still necessary with real math instead of imprecise trig tables?
|
||||||
#if 1
|
#if 1
|
||||||
|
const double fudgeamount = 1. / 65536.;
|
||||||
|
|
||||||
int side = reverse || (player && stepdown);
|
int side = reverse || (player && stepdown);
|
||||||
int fudge = FUDGEFACTOR;
|
int fudge = FUDGEFACTOR;
|
||||||
|
|
||||||
double dx = line->Delta().X;
|
double dx = line->Delta().X;
|
||||||
double dy = line->Delta().Y;
|
double dy = line->Delta().Y;
|
||||||
|
|
||||||
// Make sure we are on correct side of exit linedef.
|
// Make sure we are on correct side of exit linedef.
|
||||||
while (P_PointOnLineSidePrecise(p, l) != side && --fudge >= 0)
|
while (P_PointOnLineSidePrecise(p, l) != side && --fudge >= 0)
|
||||||
{
|
{
|
||||||
if (fabs(dx) > fabs(dy))
|
if (fabs(dx) > fabs(dy))
|
||||||
p.Y -= (dx < 0) != side ? -1 : 1;
|
p.Y -= (dx < 0) != side ? -fudgeamount : fudgeamount;
|
||||||
else
|
else
|
||||||
p.X += (dy < 0) != side ? -1 : 1;
|
p.X += (dy < 0) != side ? -fudgeamount : fudgeamount;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue