[Fixed] Teleporter bugs

Bugs that have been investigated and resolved somehow.

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49188
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Teleporter bugs

Post by Graf Zahl »

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.
Cyb
Posts: 912
Joined: Tue Jul 15, 2003 5:12 pm

Post by Cyb »

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
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49188
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49188
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

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:

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;
The angle adjustment code is never executed because it is skipped by the return above.
(I hate this kind of bug! :( )
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49188
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Yet another problem with this (again in EV_Teleport):

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49188
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

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.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm

Post by randi »

Fixed everything except the last post.

Return to “Closed Bugs [GZDoom]”