From 1314dfe53e8c682d45911fc93dbf3950378ee7ad Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Fri, 21 Apr 2023 18:56:16 -0700 Subject: [PATCH] Don't set lighting if the preset has noLighting = true (#8519) * Don't set lighting if the preset has noLighting = true Allows lighting in the preset or world processors to take over instead of being forced to disable lighting. * Less confusing style --- core/src/mindustry/game/Universe.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/game/Universe.java b/core/src/mindustry/game/Universe.java index 6ec77e62fd..01b1d714b3 100644 --- a/core/src/mindustry/game/Universe.java +++ b/core/src/mindustry/game/Universe.java @@ -82,12 +82,11 @@ public class Universe{ } } - if(state.hasSector() && state.getSector().planet.updateLighting){ - boolean disable = state.getSector().preset != null && state.getSector().preset.noLighting; + if(state.hasSector() && state.getSector().planet.updateLighting && !(state.getSector().preset != null && state.getSector().preset.noLighting)){ var planet = state.getSector().planet; //update sector light float light = state.getSector().getLight(); - float alpha = disable ? 1f : Mathf.clamp(Mathf.map(light, planet.lightSrcFrom, planet.lightSrcTo, planet.lightDstFrom, planet.lightDstTo)); + float alpha = Mathf.clamp(Mathf.map(light, planet.lightSrcFrom, planet.lightSrcTo, planet.lightDstFrom, planet.lightDstTo)); //assign and map so darkness is not 100% dark state.rules.ambientLight.a = 1f - alpha;