[PARTIAL REVERT] Removes round start lights off (keeps empty departments) (#21466)

* remove light delay round start

* Update lighting.dm

* Update lighting.dm

* empty departments only

* Update Space_Station_13_areas.dm
This commit is contained in:
Molti
2024-02-25 06:36:20 -06:00
committed by GitHub
parent b829970d88
commit 6eba384901
5 changed files with 20 additions and 20 deletions

View File

@@ -330,7 +330,8 @@ SUBSYSTEM_DEF(ticker)
PostSetup() PostSetup()
// Toggle lightswitches on in occupied departments
// Toggle lightswitches off in unoccupied departments
var/list/lightup_area_typecache = list() var/list/lightup_area_typecache = list()
var/minimal_access = CONFIG_GET(flag/jobs_have_minimal_access) var/minimal_access = CONFIG_GET(flag/jobs_have_minimal_access)
for(var/mob/living/carbon/human/player in GLOB.player_list) for(var/mob/living/carbon/human/player in GLOB.player_list)
@@ -341,11 +342,17 @@ SUBSYSTEM_DEF(ticker)
if(!job) if(!job)
continue continue
lightup_area_typecache |= job.areas_to_light_up(minimal_access) lightup_area_typecache |= job.areas_to_light_up(minimal_access)
for(var/area in lightup_area_typecache)
var/area/place = locate(area) in GLOB.areas for(var/area/place as anything in GLOB.areas)
if(!place || place.lights_always_start_on) if(!istype(place))
continue continue
place.lightswitch = TRUE if(place.lights_always_start_on)
continue
if(!is_station_level(place.z))
continue
if(is_type_in_typecache(place, lightup_area_typecache))
continue
place.lightswitch = FALSE
place.update_appearance() place.update_appearance()
for(var/obj/machinery/light_switch/lswitch in place) for(var/obj/machinery/light_switch/lswitch in place)

View File

@@ -515,7 +515,6 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/crew_quarters/theatre/abandoned /area/crew_quarters/theatre/abandoned
name = "Abandoned Theatre" name = "Abandoned Theatre"
icon_state = "Theatre" icon_state = "Theatre"
lights_always_start_on = FALSE
/area/library /area/library
name = "Library" name = "Library"

View File

@@ -135,6 +135,7 @@
/// Whether the lights in this area aren't turned off when it's empty at roundstart /// Whether the lights in this area aren't turned off when it's empty at roundstart
var/lights_always_start_on = FALSE var/lights_always_start_on = FALSE
/** /**
* A list of teleport locations * A list of teleport locations

View File

@@ -91,14 +91,6 @@
return INITIALIZE_HINT_LATELOAD return INITIALIZE_HINT_LATELOAD
return INITIALIZE_HINT_NORMAL return INITIALIZE_HINT_NORMAL
/obj/machinery/light_switch/LateInitialize()
if(!is_station_level(z))
return
var/area/source_area = get_area(get_turf(src))
if(source_area.lights_always_start_on)
return
turn_off()
/obj/machinery/light_switch/update_appearance(updates=ALL) /obj/machinery/light_switch/update_appearance(updates=ALL)
. = ..() . = ..()
luminosity = (stat & NOPOWER) ? 0 : 1 luminosity = (stat & NOPOWER) ? 0 : 1

View File

@@ -287,6 +287,9 @@
///More stress stuff. ///More stress stuff.
var/turning_on = FALSE var/turning_on = FALSE
///Flicker cooldown
COOLDOWN_DECLARE(flicker_cooldown)
/obj/machinery/light/broken /obj/machinery/light/broken
status = LIGHT_BROKEN status = LIGHT_BROKEN
icon_state = "tube-broken" icon_state = "tube-broken"
@@ -353,9 +356,6 @@
// Light projects out backwards from the dir of the light // Light projects out backwards from the dir of the light
set_light(l_dir = REVERSE_DIR(dir)) set_light(l_dir = REVERSE_DIR(dir))
if(mapload && our_area.lights_always_start_on)
turn_on(trigger = FALSE, quiet = TRUE)
return INITIALIZE_HINT_LATELOAD return INITIALIZE_HINT_LATELOAD
/obj/machinery/light/LateInitialize() /obj/machinery/light/LateInitialize()
@@ -729,8 +729,9 @@
/obj/machinery/light/proc/flicker(amount = rand(10, 20)) /obj/machinery/light/proc/flicker(amount = rand(10, 20))
set waitfor = 0 set waitfor = 0
if(flickering) if(flickering || !COOLDOWN_FINISHED(src, flicker_cooldown))
return return
COOLDOWN_START(src, flicker_cooldown, 10 SECONDS)
flickering = 1 flickering = 1
if(on && status == LIGHT_OK) if(on && status == LIGHT_OK)
for(var/i = 0; i < amount; i++) for(var/i = 0; i < amount; i++)
@@ -1075,9 +1076,9 @@
transfer_fingerprints_to(M) transfer_fingerprints_to(M)
qdel(src) qdel(src)
/proc/flicker_all_lights() /proc/flicker_all_lights() //not QUITE all lights, but it reduces lag
for(var/obj/machinery/light/L in GLOB.machines) for(var/obj/machinery/light/L in GLOB.machines)
if(is_station_level(L.z)) if(is_station_level(L.z) && prob(50))
addtimer(CALLBACK(L, TYPE_PROC_REF(/obj/machinery/light, flicker), rand(3, 6)), rand(0, 15)) addtimer(CALLBACK(L, TYPE_PROC_REF(/obj/machinery/light, flicker), rand(3, 6)), rand(0, 15))
#undef LIGHT_ON_DELAY_UPPER #undef LIGHT_ON_DELAY_UPPER