Browse Source

Fix light brightness pop on load

pull/6021/head
Anders Jenbo 3 years ago committed by Stephen C. Wills
parent
commit
d8b5c3a970
  1. 7
      Source/lighting.cpp
  2. 5
      Source/objects.cpp

7
Source/lighting.cpp

@ -239,10 +239,11 @@ void DoLighting(Point position, uint8_t radius, DisplacementOf<int8_t> 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++) {

5
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:

Loading…
Cancel
Save