- ported Eternity's Line_QuickPortal

This commit is contained in:
Timothy Quinn 2021-03-04 21:16:01 +01:00 committed by Christoph Oelckers
parent ecc4d31aa5
commit 7e74d1c4a1
2 changed files with 13 additions and 6 deletions

View file

@ -120,16 +120,18 @@ void MapLoader::SpawnLinePortal(line_t* line)
// portal destination is special argument #0
line_t* dst = nullptr;
if (line->args[2] >= PORTT_VISUAL && line->args[2] <= PORTT_LINKED)
if ((line->args[2] >= PORTT_VISUAL && line->args[2] <= PORTT_LINKED) || line->special == Line_QuickPortal)
{
dst = Level->FindPortalDestination(line, line->args[0]);
int type = (line->special != Line_QuickPortal) ? line->args[2] : line->args[0] == 0 ? PORTT_LINKED : PORTT_VISUAL;
int tag = (line->special == Line_QuickPortal) ? Level->tagManager.GetFirstLineID(line) : line->args[0];
dst = Level->FindPortalDestination(line, tag);
line->portalindex = Level->linePortals.Reserve(1);
FLinePortal *port = &Level->linePortals.Last();
port->mOrigin = line;
port->mDestination = dst;
port->mType = uint8_t(line->args[2]); // range check is done above.
port->mType = uint8_t(type); // range check is done above.
if (port->mType == PORTT_LINKED)
{
@ -138,7 +140,8 @@ void MapLoader::SpawnLinePortal(line_t* line)
}
else
{
port->mAlign = uint8_t(line->args[3] >= PORG_ABSOLUTE && line->args[3] <= PORG_CEILING ? line->args[3] : PORG_ABSOLUTE);
int flags = (line->special == Line_QuickPortal) ? PORG_ABSOLUTE : line->args[3];
port->mAlign = uint8_t(flags >= PORG_ABSOLUTE && flags <= PORG_CEILING ? flags : PORG_ABSOLUTE);
if (port->mType == PORTT_INTERACTIVE && port->mAlign != PORG_ABSOLUTE)
{
// Due to the way z is often handled, these pose a major issue for parts of the code that needs to transparently handle interactive portals.
@ -754,6 +757,7 @@ void MapLoader::SpawnSpecials ()
break;
case Line_SetPortal:
case Line_QuickPortal:
SpawnLinePortal(&line);
break;

View file

@ -138,6 +138,9 @@ DEFINE_SPECIAL(Floor_Waggle, 138, 5, 5, 5)
DEFINE_SPECIAL(Thing_SpawnFacing, 139, 2, 4, 4)
DEFINE_SPECIAL(Sector_ChangeSound, 140, 2, 2, 2)
DEFINE_SPECIAL(Line_SetHealth, 150, 2, 2, 2)
DEFINE_SPECIAL(Sector_SetHealth, 151, 3, 3, 3)
DEFINE_SPECIAL(Teleport_NoStop, 154, 2, 3, 3)
// portal specials
DEFINE_SPECIAL(Line_SetPortal, 156, -1, -1, 4)
@ -152,8 +155,6 @@ DEFINE_SPECIAL(Sector_Set3DFloor, 160, -1, -1, 5)
DEFINE_SPECIAL(Sector_SetContents, 161, -1, -1, 3)
// [RH] Begin new specials for ZDoom
DEFINE_SPECIAL(Line_SetHealth, 150, 2, 2, 2)
DEFINE_SPECIAL(Sector_SetHealth, 151, 3, 3, 3)
DEFINE_SPECIAL(Ceiling_CrushAndRaiseDist, 168, 3, 5, 5)
DEFINE_SPECIAL(Generic_Crusher2, 169, 5, 5, 5)
DEFINE_SPECIAL(Sector_SetCeilingScale2, 170, 3, 3, 3)
@ -271,4 +272,6 @@ DEFINE_SPECIAL(Ceiling_MoveToValueAndCrush, 280, 4, 5, 5)
DEFINE_SPECIAL(Line_SetAutomapFlags, 281, 3, 3, 3)
DEFINE_SPECIAL(Line_SetAutomapStyle, 282, 2, 2, 2)
DEFINE_SPECIAL(Line_QuickPortal, 301, -1, -1, 1)
#undef DEFINE_SPECIAL