GenericCAO: Fix glow not working since a08d18a
authorSmallJoker <mk939@ymail.com>
Sun, 7 Jun 2020 12:17:32 +0000 (14:17 +0200)
committerSmallJoker <mk939@ymail.com>
Sun, 7 Jun 2020 12:17:32 +0000 (14:17 +0200)
src/client/content_cao.cpp

index 702d089afe582a824929d9269c64c849a7dfb0e6..85572964226c7e93a4d203898ad13f712d63e0b5 100644 (file)
@@ -787,6 +787,9 @@ void GenericCAO::addToScene(ITextureSource *tsrc)
 
 void GenericCAO::updateLight(u32 day_night_ratio)
 {
+       if (m_glow < 0)
+               return;
+
        u8 light_at_pos = 0;
        bool pos_ok;
 
@@ -797,7 +800,7 @@ void GenericCAO::updateLight(u32 day_night_ratio)
        else
                light_at_pos = blend_light(day_night_ratio, LIGHT_SUN, 0);
 
-       u8 light = decode_light(light_at_pos);
+       u8 light = decode_light(light_at_pos + m_glow);
        if (light != m_last_light) {
                m_last_light = light;
                setNodeLight(light);