diff --git a/source/core/maptypes.h b/source/core/maptypes.h index dcb946a68..055ef076e 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -100,6 +100,7 @@ enum ESectorExBits SECTOREX_CLOUDSCROLL = 1, SECTOREX_DRAGGED = 2, SECTOREX_DONTCLIP = 4, + SECTOREX_SEEN = 8, }; // Flags for retriangulation diff --git a/source/core/rendering/scene/hw_flats.cpp b/source/core/rendering/scene/hw_flats.cpp index 80e75ccfa..7490ac5bb 100644 --- a/source/core/rendering/scene/hw_flats.cpp +++ b/source/core/rendering/scene/hw_flats.cpp @@ -319,6 +319,7 @@ void HWFlat::ProcessSector(HWDrawInfo *di, sectortype * frontsector, int section PlanesAtPoint(frontsector, vp.Pos.X, -vp.Pos.Y, &ceilz, &florz); visibility = sectorVisibility(frontsector); + frontsector->exflags |= SECTOREX_SEEN; sec = frontsector; section = section_; Sprite = nullptr; diff --git a/source/games/duke/src/actors_lava.cpp b/source/games/duke/src/actors_lava.cpp index d148962dd..97bd8f8c8 100644 --- a/source/games/duke/src/actors_lava.cpp +++ b/source/games/duke/src/actors_lava.cpp @@ -479,8 +479,18 @@ void thunder(void) } if (!winderflash && isRR()) { - auto tex = tileGetTexture(RTILE_CURTAINS); // this cannot be easily generalized. :( - if (tex->isSeen(true)) + bool seen = false; + for (i = 0; i < lightnincnt; i++) + { + auto sectp = lightninsector[i]; + if (sectp->exflags & SECTOREX_SEEN) + { + seen = true; + sectp->exflags &= ~SECTOREX_SEEN; + } + } + + if (seen) { if (krand() > 65000) {