Skip to content

Commit

Permalink
- Line_QuickPortal must check the partner line's special.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ursus-maritimus210 authored and coelckers committed Mar 5, 2021
1 parent 0c0ef4f commit fa2228d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/g_levellocals.h
Expand Up @@ -151,7 +151,7 @@ struct FLevelLocals

private:
bool ShouldDoIntermission(cluster_info_t* nextcluster, cluster_info_t* thiscluster);
line_t *FindPortalDestination(line_t *src, int tag);
line_t *FindPortalDestination(line_t *src, int tag, int matchtype = -1);
void BuildPortalBlockmap();
void UpdatePortal(FLinePortal *port);
void CollectLinkedPortals();
Expand Down
2 changes: 1 addition & 1 deletion src/maploader/specials.cpp
Expand Up @@ -124,7 +124,7 @@ void MapLoader::SpawnLinePortal(line_t* line)
{
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);
dst = Level->FindPortalDestination(line, tag, line->special == Line_QuickPortal? Line_QuickPortal : -1);

line->portalindex = Level->linePortals.Reserve(1);
FLinePortal *port = &Level->linePortals.Last();
Expand Down
4 changes: 2 additions & 2 deletions src/playsim/portal.cpp
Expand Up @@ -175,7 +175,7 @@ void FLinePortalTraverse::AddLineIntercepts(int bx, int by)
//
//============================================================================

line_t *FLevelLocals::FindPortalDestination(line_t *src, int tag)
line_t *FLevelLocals::FindPortalDestination(line_t *src, int tag, int matchtype)
{
if (tag)
{
Expand All @@ -184,7 +184,7 @@ line_t *FLevelLocals::FindPortalDestination(line_t *src, int tag)

while ((lineno = it.Next()) >= 0)
{
if (&lines[lineno] != src)
if (&lines[lineno] != src && (matchtype == -1 || matchtype == lines[lineno].special))
{
return &lines[lineno];
}
Expand Down

0 comments on commit fa2228d

Please sign in to comment.