mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
Restored vanilla behavior of lightning for original Hexen
https://forum.zdoom.org/viewtopic.php?t=60103
This commit is contained in:
parent
2e7d196f8b
commit
b6f184491b
1 changed files with 27 additions and 0 deletions
|
@ -36,6 +36,7 @@
|
|||
#include "serializer.h"
|
||||
#include "g_levellocals.h"
|
||||
#include "events.h"
|
||||
#include "gi.h"
|
||||
|
||||
static FRandom pr_lightning ("Lightning");
|
||||
|
||||
|
@ -205,6 +206,32 @@ static DLightningThinker *LocateLightning ()
|
|||
|
||||
void P_StartLightning ()
|
||||
{
|
||||
const bool isOriginalHexen = (gameinfo.gametype == GAME_Hexen)
|
||||
&& (level.flags2 & LEVEL2_HEXENHACK);
|
||||
|
||||
if (isOriginalHexen)
|
||||
{
|
||||
bool hasLightning = false;
|
||||
|
||||
for (const sector_t §or : level.sectors)
|
||||
{
|
||||
hasLightning = sector.GetTexture(sector_t::ceiling) == skyflatnum
|
||||
|| sector.special == Light_IndoorLightning1
|
||||
|| sector.special == Light_IndoorLightning2;
|
||||
|
||||
if (hasLightning)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasLightning)
|
||||
{
|
||||
level.flags &= ~LEVEL_STARTLIGHTNING;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
DLightningThinker *lightning = LocateLightning ();
|
||||
if (lightning == NULL)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue