- made Teleport_NoFog compatible with Hexen and Eternity.

ZDoom defaulted to Boom's (buggy) angle adjustment.
Changed it so that
 * Mode 0 is like Hexen, performing no adjustment at all. This still should match all known maps using this special.
 * Mode 1 remains unchanged.
 * Mode 2 replicates Boom's broken angle adjustment and is used in the xlat file.
 * Mode 3 implements the correct angle adjustment that Boom originally intended.

 (Note: Should some map require something different it should be handled with compatibility.txt instead of reverting this back to the broken way it was before.)
This commit is contained in:
Christoph Oelckers 2016-04-23 21:32:40 +02:00
parent eaabb5e986
commit f420ccd287
4 changed files with 35 additions and 14 deletions

View file

@ -1053,10 +1053,25 @@ FUNC(LS_Teleport_NoFog)
// Teleport_NoFog (tid, useang, sectortag, keepheight) // Teleport_NoFog (tid, useang, sectortag, keepheight)
{ {
int flags = 0; int flags = 0;
if (!arg1) switch (arg1)
{ {
case 0:
flags |= TELF_KEEPORIENTATION; flags |= TELF_KEEPORIENTATION;
break;
default:
case 1:
break;
case 2:
flags |= TELF_KEEPORIENTATION | TELF_ROTATEBOOM; // adjust to exit thing like Boom (i.e. with incorrect reversed angle)
break;
case 3:
flags |= TELF_KEEPORIENTATION | TELF_ROTATEBOOMINVERSE; // adjust to exit thing correctly
break;
} }
if (arg3) if (arg3)
{ {
flags |= TELF_KEEPHEIGHT; flags |= TELF_KEEPHEIGHT;

View file

@ -666,6 +666,8 @@ enum
TELF_KEEPORIENTATION = 4, TELF_KEEPORIENTATION = 4,
TELF_KEEPVELOCITY = 8, TELF_KEEPVELOCITY = 8,
TELF_KEEPHEIGHT = 16, TELF_KEEPHEIGHT = 16,
TELF_ROTATEBOOM = 32,
TELF_ROTATEBOOMINVERSE = 64,
}; };
//Spawns teleport fog. Pass the actor to pluck TeleFogFromType and TeleFogToType. 'from' determines if this is the fog to spawn at the old position (true) or new (false). //Spawns teleport fog. Pass the actor to pluck TeleFogFromType and TeleFogToType. 'from' determines if this is the fog to spawn at the old position (true) or new (false).

View file

@ -349,13 +349,14 @@ bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, int f
return false; return false;
} }
// [RH] Lee Killough's changes for silent teleporters from BOOM // [RH] Lee Killough's changes for silent teleporters from BOOM
if ((flags & TELF_KEEPORIENTATION) && line) if ((flags & (TELF_ROTATEBOOM|TELF_ROTATEBOOMINVERSE)) && line)
{ {
// Get the angle between the exit thing and source linedef. // Get the angle between the exit thing and source linedef.
// Rotate 90 degrees, so that walking perpendicularly across // Rotate 90 degrees, so that walking perpendicularly across
// teleporter linedef causes thing to exit in the direction // teleporter linedef causes thing to exit in the direction
// indicated by the exit thing. // indicated by the exit thing.
angle = line->Delta().Angle() - searcher->Angles.Yaw + 90.; angle = line->Delta().Angle() - searcher->Angles.Yaw + 90.;
if (flags & TELF_ROTATEBOOMINVERSE) angle = -angle;
// Sine, cosine of angle adjustment // Sine, cosine of angle adjustment
s = angle.Sin(); s = angle.Sin();
@ -382,15 +383,18 @@ bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, int f
if (P_Teleport (thing, DVector3(searcher->Pos(), z), searcher->Angles.Yaw + badangle, flags)) if (P_Teleport (thing, DVector3(searcher->Pos(), z), searcher->Angles.Yaw + badangle, flags))
{ {
// [RH] Lee Killough's changes for silent teleporters from BOOM // [RH] Lee Killough's changes for silent teleporters from BOOM
if (!(flags & TELF_DESTFOG) && line && (flags & TELF_KEEPORIENTATION)) if (line)
{ {
// Rotate thing according to difference in angles if (flags & (TELF_ROTATEBOOM| TELF_ROTATEBOOMINVERSE))
{
// Rotate thing according to difference in angles (or not - Boom got the direction wrong here.)
thing->Angles.Yaw += angle; thing->Angles.Yaw += angle;
// Rotate thing's velocity to come out of exit just like it entered // Rotate thing's velocity to come out of exit just like it entered
thing->Vel.X = vx*c - vy*s; thing->Vel.X = vx*c - vy*s;
thing->Vel.Y = vy*c + vx*s; thing->Vel.Y = vy*c + vx*s;
} }
}
if (vx == 0 && vy == 0 && thing->player != NULL && thing->player->mo == thing && !predicting) if (vx == 0 && vy == 0 && thing->player != NULL && thing->player->mo == thing && !predicting)
{ {
thing->player->mo->PlayIdle (); thing->player->mo->PlayIdle ();

View file

@ -209,10 +209,10 @@ include "xlat/defines.i"
204 = USE, Ceiling_LowerToHighestFloor (tag, C_SLOW) 204 = USE, Ceiling_LowerToHighestFloor (tag, C_SLOW)
205 = USE|REP, Ceiling_LowerToLowest (tag, C_SLOW) 205 = USE|REP, Ceiling_LowerToLowest (tag, C_SLOW)
206 = USE|REP, Ceiling_LowerToHighestFloor (tag, C_SLOW) 206 = USE|REP, Ceiling_LowerToHighestFloor (tag, C_SLOW)
207 = WALK|MONST, Teleport_NoFog (0, 0, tag, 1) 207 = WALK|MONST, Teleport_NoFog (0, 2, tag, 1)
208 = WALK|REP|MONST, Teleport_NoFog (0, 0, tag, 1) 208 = WALK|REP|MONST, Teleport_NoFog (0, 2, tag, 1)
209 = USE|MONST, Teleport_NoFog (0, 0, tag, 1) 209 = USE|MONST, Teleport_NoFog (0, 2, tag, 1)
210 = USE|REP|MONST, Teleport_NoFog (0, 0, tag, 1) 210 = USE|REP|MONST, Teleport_NoFog (0, 2, tag, 1)
211 = USE|REP, Plat_ToggleCeiling (tag) 211 = USE|REP, Plat_ToggleCeiling (tag)
212 = WALK|REP, Plat_ToggleCeiling (tag) 212 = WALK|REP, Plat_ToggleCeiling (tag)
213 = 0, Transfer_FloorLight (tag) 213 = 0, Transfer_FloorLight (tag)
@ -270,8 +270,8 @@ include "xlat/defines.i"
265 = MONWALK|REP, Teleport_Line (tag, tag, 1) 265 = MONWALK|REP, Teleport_Line (tag, tag, 1)
266 = MONWALK, Teleport_Line (tag, tag, 0) 266 = MONWALK, Teleport_Line (tag, tag, 0)
267 = MONWALK|REP, Teleport_Line (tag, tag, 0) 267 = MONWALK|REP, Teleport_Line (tag, tag, 0)
268 = MONWALK, Teleport_NoFog (0, 0, tag, 1) 268 = MONWALK, Teleport_NoFog (0, 2, tag, 1)
269 = MONWALK|REP, Teleport_NoFog (0, 0, tag, 1) 269 = MONWALK|REP, Teleport_NoFog (0, 2, tag, 1)
/****** MBF linetypes ******/ /****** MBF linetypes ******/