From b90173ed21bc5caece2eec530c3c5a37c64618a9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 8 May 2016 09:34:22 +0200 Subject: [PATCH] - fixed: ADynamicLight::visibletoplayer was not initialized for placed lights when restoring a savegame. --- src/gl/dynlights/a_dynlight.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gl/dynlights/a_dynlight.cpp b/src/gl/dynlights/a_dynlight.cpp index 5458f0479..ef96fdd3e 100644 --- a/src/gl/dynlights/a_dynlight.cpp +++ b/src/gl/dynlights/a_dynlight.cpp @@ -48,6 +48,7 @@ #include "doomdata.h" #include "r_utility.h" #include "portal.h" +#include "doomstat.h" #include "gl/renderer/gl_renderer.h" @@ -143,8 +144,13 @@ void ADynamicLight::Serialize(FArchive &arc) arc << m_Radius[0] << m_Radius[1]; if (lighttype == PulseLight) arc << m_lastUpdate << m_cycler; - if (arc.IsLoading()) LinkLight(); - + if (arc.IsLoading()) + { + // The default constructor which is used for creating objects before deserialization will not set this variable. + // It needs to be true for all placed lights. + visibletoplayer = true; + LinkLight(); + } }