- make RR's ingame thunder effect not depend on having seen one specific texture.

This really should check if the player has seen one sector where the effect is active.
This commit is contained in:
Christoph Oelckers 2022-12-13 21:22:27 +01:00
parent 8208c7fc0b
commit 6248c8813b
3 changed files with 14 additions and 2 deletions

View file

@ -100,6 +100,7 @@ enum ESectorExBits
SECTOREX_CLOUDSCROLL = 1,
SECTOREX_DRAGGED = 2,
SECTOREX_DONTCLIP = 4,
SECTOREX_SEEN = 8,
};
// Flags for retriangulation

View file

@ -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;

View file

@ -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)
{