From d8b5c3a9708c9d4ae69fcb60f8a5529c229afbb1 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 18 Apr 2023 18:37:26 +0200 Subject: [PATCH] Fix light brightness pop on load --- Source/lighting.cpp | 7 ++++--- Source/objects.cpp | 5 ++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/lighting.cpp b/Source/lighting.cpp index 796b445e6..c6c52386a 100644 --- a/Source/lighting.cpp +++ b/Source/lighting.cpp @@ -239,10 +239,11 @@ void DoLighting(Point position, uint8_t radius, DisplacementOf offset) maxY = MAXDUNY - position.y; } - if (IsNoneOf(leveltype, DTYPE_NEST, DTYPE_CRYPT)) { - SetLight(position, 0); - } else if (GetLight(position) > LightFalloffs[radius][0]) { + // Allow for dim lights in crypt and nest + if (IsAnyOf(leveltype, DTYPE_NEST, DTYPE_CRYPT)) { SetLight(position, LightFalloffs[radius][0]); + } else if (GetLight(position) > LightFalloffs[radius][0]) { + SetLight(position, 0); } for (int i = 0; i < 4; i++) { diff --git a/Source/objects.cpp b/Source/objects.cpp index 9492b609c..4b553f11c 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -4224,9 +4224,8 @@ void ProcessObjects() Object &object = Objects[ActiveObjects[i]]; switch (object._otype) { case OBJ_L1LIGHT: - UpdateObjectLight(object, 10); - break; case OBJ_SKFIRE: + case OBJ_CANDLE1: case OBJ_CANDLE2: case OBJ_BOOKCANDLE: UpdateObjectLight(object, 5); @@ -4281,7 +4280,7 @@ void ProcessObjects() break; case OBJ_BCROSS: case OBJ_TBCROSS: - UpdateObjectLight(object, 10); + UpdateObjectLight(object, 5); UpdateBurningCrossDamage(object); break; default: