From b15e620ea85ec545850fce384e9109b8287af525 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 20 Dec 2016 18:26:33 +0100 Subject: [PATCH] - fixed: Phased light setup did not check if a sector had been already visited and could cause infinite recursion. --- src/p_lights.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_lights.cpp b/src/p_lights.cpp index 910c52a64..a05199b91 100644 --- a/src/p_lights.cpp +++ b/src/p_lights.cpp @@ -31,6 +31,7 @@ #include "p_lnspec.h" #include "doomstat.h" +#include "p_maputl.h" // State. #include "r_state.h" @@ -914,7 +915,7 @@ void DPhased::Tick () int DPhased::PhaseHelper (sector_t *sector, int index, int light, sector_t *prev) { - if (!sector) + if (!sector || sector->validcount == validcount) { return index; } @@ -922,6 +923,7 @@ int DPhased::PhaseHelper (sector_t *sector, int index, int light, sector_t *prev { DPhased *l; int baselevel = sector->lightlevel ? sector->lightlevel : light; + sector->validcount = validcount; if (index == 0) { @@ -958,6 +960,7 @@ DPhased::DPhased (sector_t *sector, int baselevel) DPhased::DPhased (sector_t *sector) : DLighting (sector) { + validcount++; PhaseHelper (sector, 0, 0, NULL); }