From f52e767b516a7c45ffad356e7b70c4a9faa2a1ca Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 12 Aug 2017 12:51:45 +0200 Subject: [PATCH] - fixed: a destination-less line portal should be ignored by the sight checking code. --- src/p_sight.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_sight.cpp b/src/p_sight.cpp index f86ae4c22e..62f9735285 100644 --- a/src/p_sight.cpp +++ b/src/p_sight.cpp @@ -236,7 +236,7 @@ bool SightCheck::PTR_SightTraverse (intercept_t *in) FLinePortal *lport = li->getPortal(); - if (open.range == 0 && open.portalflags == 0 && (lport == NULL || lport->mType != PORTT_LINKED)) // quick test for totally closed doors (must be delayed if portal checks are needed, though) + if (open.range == 0 && open.portalflags == 0 && (lport == nullptr || lport->mType != PORTT_LINKED)) // quick test for totally closed doors (must be delayed if portal checks are needed, though) return false; // stop if (in->frac == 0) @@ -284,7 +284,7 @@ bool SightCheck::PTR_SightTraverse (intercept_t *in) portals.Push({ in->frac, topslope, bottomslope, sector_t::floor, backsec->GetOppositePortalGroup(sector_t::floor) }); } } - if (lport) + if (lport != nullptr && lport->mDestination != nullptr) { portals.Push({ in->frac, topslope, bottomslope, portaldir, lport->mDestination->frontsector->PortalGroup }); return false;