From cd778b6bdc09924cf78e529f8afcd1495820bc5d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 13 Jan 2016 00:15:04 +0100 Subject: [PATCH] - fixed CollectPortalSectors --- src/gl/data/gl_portaldata.cpp | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/gl/data/gl_portaldata.cpp b/src/gl/data/gl_portaldata.cpp index 676f6a630..7841512e0 100644 --- a/src/gl/data/gl_portaldata.cpp +++ b/src/gl/data/gl_portaldata.cpp @@ -354,24 +354,17 @@ static void CollectPortalSectors(FPortalMap &collection) for (int i=0;iCeilingSkyBox != NULL && sec->CeilingSkyBox->bAlways && sec->CeilingSkyBox->Mate != NULL) + for (int j = 0; j < 2; j++) { - FPortalID id = { sec->CeilingSkyBox->x - sec->CeilingSkyBox->Mate->x, - sec->CeilingSkyBox->y - sec->CeilingSkyBox->Mate->y}; + ASkyViewpoint *SkyBox = sec->SkyBoxes[j]; + if (SkyBox != NULL && SkyBox->bAlways && SkyBox->Mate != NULL) + { + FPortalID id = { SkyBox->x - SkyBox->Mate->x, SkyBox->y - SkyBox->Mate->y }; - FPortalSectors &sss = collection[id]; - FPortalSector ss = { sec, sector_t::ceiling }; - sss.Push(ss); - } - - if (sec->FloorSkyBox != NULL && sec->FloorSkyBox->bAlways && sec->FloorSkyBox->Mate != NULL) - { - FPortalID id = { sec->FloorSkyBox->x - sec->FloorSkyBox->Mate->x, - sec->FloorSkyBox->y - sec->FloorSkyBox->Mate->y }; - - FPortalSectors &sss = collection[id]; - FPortalSector ss = { sec, sector_t::floor }; - sss.Push(ss); + FPortalSectors &sss = collection[id]; + FPortalSector ss = { sec, j }; + sss.Push(ss); + } } } }