fix shuttles and turbolifts ending up outdoors (#17248)

* fix shuttles and turbolifts ending up outdoors

* light fixes

* .

* clamp brightness
This commit is contained in:
Kashargul
2025-03-04 01:39:17 +01:00
committed by GitHub
parent 1102b4f3e8
commit d024ece20c
5 changed files with 57 additions and 20 deletions
+44 -17
View File
@@ -11,29 +11,31 @@ var/static/list/fake_sunlight_zs = list()
var/family = null //Allows multipe maps that are THEORETICALLY connected to use the same settings when not in a connected Z stack
var/shared_settings //Automatically set if using the family var
var/static/world_suns = list() //List of all the fake_suns in the world, used for checking for family members
var/list/choice
var/do_sun = TRUE
var/do_weather = FALSE
var/advanced_lighting = FALSE
var/list/possible_light_setups = list(
list(
"brightness" = 6.0,
"brightness" = 1,
"color" = "#abfff7"
),
list(
"brightness" = 4.0,
"brightness" = 1,
"color" = "#F4EA55"
),
list(
"brightness" = 2.5,
"brightness" = 1,
"color" = "#EE9AC6"
),
list(
"brightness" = 1.5,
"brightness" = 1,
"color" = "#F07AD8"
),
list(
"brightness" = 1.5,
"brightness" = 1,
"color" = "#61AEF3"
),
list(
@@ -45,15 +47,15 @@ var/static/list/fake_sunlight_zs = list()
"color" = "#631E8A"
),
list(
"brightness" = 1.0,
"brightness" = 1,
"color" = "#A3A291"
),
list(
"brightness" = 1.0,
"brightness" = 1,
"color" = "#F07AD8"
),
list(
"brightness" = 1.0,
"brightness" = 1,
"color" = "#61AEF3"
),
list(
@@ -96,11 +98,36 @@ var/static/list/fake_sunlight_zs = list()
/obj/effect/fake_sun/Initialize()
..()
if(!advanced_lighting)
return INITIALIZE_HINT_LATELOAD
do_sun = FALSE
//Copied code
if(family) //Allows one to make multiple fake_suns to use the same settings
for(var/obj/effect/fake_sun/l in world_suns) //check all the suns that exist
if(l.family == family && l.shared_settings) //do you have settings we need?
choice = l.shared_settings
break
if(!choice) //We didn't get anything from our family, let's pick something
choice = pick(possible_light_setups)
if(family) //Let's pass our settings on to our family
shared_settings = choice
if(choice["brightness"] <= LIGHTING_SOFT_THRESHOLD) // dark!
return
//Copied code end
var/datum/simple_sun/Ssun = new()
Ssun.brightness = CLAMP01(choice["brightness"])
Ssun.color = choice["color"]
var/datum/planet_sunlight_handler/pshandler = new(Ssun)
if(z > SSlighting.z_to_pshandler.len)
SSlighting.z_to_pshandler.len = z
SSlighting.z_to_pshandler[z] = pshandler
SSlighting.update_sunlight(pshandler) //Queue an update for when it starts running
return INITIALIZE_HINT_LATELOAD
/obj/effect/fake_sun/LateInitialize()
. = ..()
var/list/choice
if(family) //Allows one to make multiple fake_suns to use the same settings
for(var/obj/effect/fake_sun/l in world_suns) //check all the suns that exist
if(l.family == family && l.shared_settings) //do you have settings we need?
@@ -157,20 +184,20 @@ var/static/list/fake_sunlight_zs = list()
possible_light_setups = list(
list(
"brightness" = 6.0,
"brightness" = 1,
"color" = "#E9FFB8"
),
list(
"brightness" = 4.0,
"brightness" = 1,
"color" = "#F4EA55"
),
list(
"brightness" = 4.0,
"brightness" = 1,
"color" = "#F07AD8"
),
list(
"brightness" = 4.0,
"brightness" = 1,
"color" = "#f3932d"
)
@@ -182,19 +209,19 @@ var/static/list/fake_sunlight_zs = list()
possible_light_setups = list(
list(
"brightness" = 6.0,
"brightness" = 1,
"color" = "#abfff7"
),
list(
"brightness" = 4.0,
"brightness" = 1,
"color" = "#2e30c9"
),
list(
"brightness" = 1.0,
"brightness" = 1,
"color" = "#61AEF3"
),
list(
"brightness" = 1.0,
"brightness" = 1,
"color" = "#61ddf3"
),
list(
+1 -1
View File
@@ -124,5 +124,5 @@
/datum/simple_sun/planetary/update()
. = ..()
brightness = sun.our_brightness
brightness = CLAMP01(sun.our_brightness)
color = sun.our_color