diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 49aac88c5..2462f036c 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -1053,10 +1053,25 @@ FUNC(LS_Teleport_NoFog) // Teleport_NoFog (tid, useang, sectortag, keepheight) { int flags = 0; - if (!arg1) + switch (arg1) { + case 0: 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) { flags |= TELF_KEEPHEIGHT; diff --git a/src/p_spec.h b/src/p_spec.h index 0899c6268..7bd04f48c 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -666,6 +666,8 @@ enum TELF_KEEPORIENTATION = 4, TELF_KEEPVELOCITY = 8, 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). diff --git a/src/p_teleport.cpp b/src/p_teleport.cpp index 40ae4efed..a3dbd0899 100644 --- a/src/p_teleport.cpp +++ b/src/p_teleport.cpp @@ -349,13 +349,14 @@ bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, int f return false; } // [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. // Rotate 90 degrees, so that walking perpendicularly across // teleporter linedef causes thing to exit in the direction // indicated by the exit thing. angle = line->Delta().Angle() - searcher->Angles.Yaw + 90.; + if (flags & TELF_ROTATEBOOMINVERSE) angle = -angle; // Sine, cosine of angle adjustment s = angle.Sin(); @@ -382,14 +383,17 @@ 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)) { // [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 - thing->Angles.Yaw += angle; + 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; - // Rotate thing's velocity to come out of exit just like it entered - thing->Vel.X = vx*c - vy*s; - thing->Vel.Y = vy*c + vx*s; + // Rotate thing's velocity to come out of exit just like it entered + thing->Vel.X = vx*c - vy*s; + thing->Vel.Y = vy*c + vx*s; + } } if (vx == 0 && vy == 0 && thing->player != NULL && thing->player->mo == thing && !predicting) { diff --git a/wadsrc/static/xlat/base.txt b/wadsrc/static/xlat/base.txt index d125c4903..8a99ba318 100644 --- a/wadsrc/static/xlat/base.txt +++ b/wadsrc/static/xlat/base.txt @@ -209,10 +209,10 @@ include "xlat/defines.i" 204 = USE, Ceiling_LowerToHighestFloor (tag, C_SLOW) 205 = USE|REP, Ceiling_LowerToLowest (tag, C_SLOW) 206 = USE|REP, Ceiling_LowerToHighestFloor (tag, C_SLOW) -207 = WALK|MONST, Teleport_NoFog (0, 0, tag, 1) -208 = WALK|REP|MONST, Teleport_NoFog (0, 0, tag, 1) -209 = USE|MONST, Teleport_NoFog (0, 0, tag, 1) -210 = USE|REP|MONST, Teleport_NoFog (0, 0, tag, 1) +207 = WALK|MONST, Teleport_NoFog (0, 2, tag, 1) +208 = WALK|REP|MONST, Teleport_NoFog (0, 2, tag, 1) +209 = USE|MONST, Teleport_NoFog (0, 2, tag, 1) +210 = USE|REP|MONST, Teleport_NoFog (0, 2, tag, 1) 211 = USE|REP, Plat_ToggleCeiling (tag) 212 = WALK|REP, Plat_ToggleCeiling (tag) 213 = 0, Transfer_FloorLight (tag) @@ -270,8 +270,8 @@ include "xlat/defines.i" 265 = MONWALK|REP, Teleport_Line (tag, tag, 1) 266 = MONWALK, Teleport_Line (tag, tag, 0) 267 = MONWALK|REP, Teleport_Line (tag, tag, 0) -268 = MONWALK, Teleport_NoFog (0, 0, tag, 1) -269 = MONWALK|REP, Teleport_NoFog (0, 0, tag, 1) +268 = MONWALK, Teleport_NoFog (0, 2, tag, 1) +269 = MONWALK|REP, Teleport_NoFog (0, 2, tag, 1) /****** MBF linetypes ******/