[Fixed] Teleporter bugs
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
-
- Lead GZDoom+Raze Developer
- Posts: 49188
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Teleporter bugs
While investigating some teleporter problems I discovered that several calls to P_Teleport swap the z and angle parameter in the function call. (in a_korax.cpp and a_teleportother.cpp)
Last edited by Graf Zahl on Fri Dec 26, 2003 12:41 pm, edited 1 time in total.
-
- Posts: 912
- Joined: Tue Jul 15, 2003 5:12 pm
-
- Lead GZDoom+Raze Developer
- Posts: 49188
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Cyb wrote:using teleport_nofog with a second argument of 1 (teleport_nofog(tid, 1)) will cause the player to face the direction of the teleport destination's angle rather than the angle they were facing when they were teleported
Yes, it turned out the level I was using had the things placed wrong. You should think at least a mapper tests his level sufficiently. I changed the bug report accordingly.
-
- Lead GZDoom+Raze Developer
- Posts: 49188
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
I found my problem. Aside from the level having a bug there is a serious bug in the teleporting code which prevents the angle of the teleported thing being set if the teleport exit does not face in the same direction as the teleport line:
The angle adjustment code is never executed because it is skipped by the return above.
(I hate this kind of bug! )
Code: Select all
if (P_Teleport (thing, searcher->x, searcher->y, z, searcher->angle, fog,keeporientation))
{
return true;
}
// [RH] Lee Killough's changes for silent teleporters from BOOM
if (!fog && line && keeporientation)
{
// Rotate thing according to difference in angles
thing->angle += angle;
// Rotate thing's momentum to come out of exit just like it entered
thing->momx = FixedMul(momx, c) - FixedMul(momy, s);
thing->momy = FixedMul(momy, c) + FixedMul(momx, s);
}
return false;
(I hate this kind of bug! )
-
- Lead GZDoom+Raze Developer
- Posts: 49188
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Yet another problem with this (again in EV_Teleport):
This code to calculate the exit angle uses the teleported thing's, not the teleport destination's angle.
Code: Select all
angle = R_PointToAngle2 (0, 0, line->dx, line->dy) - thing->angle + ANG90;
This code to calculate the exit angle uses the teleported thing's, not the teleport destination's angle.
-
- Lead GZDoom+Raze Developer
- Posts: 49188
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Ok, now it seems to work as in Boom. However, I have the feeling that the rotation is done in the wrong direction. If I do a rotation of 90 degrees with these teleporters I have to make the teleport destination face toward the teleport line not away from it. Since this was the same in Boom (at least PrBoom has the same problem) I don't think this should be fixed unless it has a compatibility option because I have no idea how many maps use this incorrect behavior.
-
- Site Admin
- Posts: 7749
- Joined: Wed Jul 09, 2003 10:30 pm