Remove SS_NO_TICK_CHECK (#57800)

## About The Pull Request
This is a whopper, will need @MrStonedOne to review.
In theory this flag shouldn't be needed and my own testing didn't find any issues, but I'd feel better with a lengthy test merge.

## Why It's Good For The Game
Might make nightshift subsystem lag less, MC loop has less stuff to check.
This commit is contained in:
spookydonut
2021-03-28 12:10:18 -04:00
committed by GitHub
parent e692b05a99
commit 9be229fd2c
7 changed files with 21 additions and 39 deletions
+18 -12
View File
@@ -1,7 +1,6 @@
SUBSYSTEM_DEF(nightshift)
name = "Night Shift"
wait = 600
flags = SS_NO_TICK_CHECK
wait = 10 MINUTES
var/nightshift_active = FALSE
var/nightshift_start_time = 702000 //7:30 PM, station time
@@ -9,6 +8,7 @@ SUBSYSTEM_DEF(nightshift)
var/nightshift_first_check = 30 SECONDS
var/high_security_mode = FALSE
var/list/currentrun
/datum/controller/subsystem/nightshift/Initialize()
if(!CONFIG_GET(flag/enable_night_shifts))
@@ -16,6 +16,9 @@ SUBSYSTEM_DEF(nightshift)
return ..()
/datum/controller/subsystem/nightshift/fire(resumed = FALSE)
if(resumed)
update_nightshift(resumed = TRUE)
return
if(world.time - SSticker.round_start_time < nightshift_first_check)
return
check_nightshift()
@@ -41,15 +44,18 @@ SUBSYSTEM_DEF(nightshift)
if(nightshift_active != night_time)
update_nightshift(night_time, announcing)
/datum/controller/subsystem/nightshift/proc/update_nightshift(active, announce = TRUE)
nightshift_active = active
if(announce)
if (active)
announce("Good evening, crew. To reduce power consumption and stimulate the circadian rhythms of some species, all of the lights aboard the station have been dimmed for the night.")
else
announce("Good morning, crew. As it is now day time, all of the lights aboard the station have been restored to their former brightness.")
for(var/A in GLOB.apcs_list)
var/obj/machinery/power/apc/APC = A
/datum/controller/subsystem/nightshift/proc/update_nightshift(active, announce = TRUE, resumed = FALSE)
if(!resumed)
currentrun = GLOB.apcs_list.Copy()
nightshift_active = active
if(announce)
if (active)
announce("Good evening, crew. To reduce power consumption and stimulate the circadian rhythms of some species, all of the lights aboard the station have been dimmed for the night.")
else
announce("Good morning, crew. As it is now day time, all of the lights aboard the station have been restored to their former brightness.")
for(var/obj/machinery/power/apc/APC as anything in currentrun)
currentrun -= APC
if (APC.area && (APC.area.type in GLOB.the_station_areas))
APC.set_nightshift(active)
CHECK_TICK
if(MC_TICK_CHECK)
return